Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add host flag for relay #419

Merged
merged 1 commit into from
Oct 2, 2021
Merged

Add host flag for relay #419

merged 1 commit into from
Oct 2, 2021

Conversation

kallydev
Copy link
Contributor

@kallydev kallydev commented Oct 1, 2021

Resolved #416.

Although net.Listen("tcp", addr) display IPv6, it also provides support for IPv4, ref golang/go#9334.

$ croc relay
[info]  2021/10/01 13:00:34 starting croc relay version v9.3.0-94b2aff
[info]  2021/10/01 13:00:34 starting TCP server on :9009
[info]  2021/10/01 13:00:34 starting TCP server on :9012
[info]  2021/10/01 13:00:34 starting TCP server on :9011
[info]  2021/10/01 13:00:34 starting TCP server on :9010
[info]  2021/10/01 13:00:34 starting TCP server on :9013

$ lsof -i :9009
COMMAND   PID     USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
main    31243 kallydev    5u  IPv6 0x786f7593799ac31b      0t0  TCP *:pichat (LISTEN)
$ croc relay --host 0.0.0.0
[info]  2021/10/01 12:58:49 starting croc relay version v9.3.0-94b2aff
[info]  2021/10/01 12:58:49 starting TCP server on 0.0.0.0:9009
[info]  2021/10/01 12:58:49 starting TCP server on 0.0.0.0:9011
[info]  2021/10/01 12:58:49 starting TCP server on 0.0.0.0:9013
[info]  2021/10/01 12:58:49 starting TCP server on 0.0.0.0:9012
[info]  2021/10/01 12:58:49 starting TCP server on 0.0.0.0:9010

$ lsof -i :9009
COMMAND   PID     USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
main    31367 kallydev    5u  IPv4 0x786f7593a7a196f3      0t0  TCP *:pichat (LISTEN)
$ croc relay --host :: 
[info]  2021/10/01 12:59:46 starting croc relay version v9.3.0-94b2aff
[info]  2021/10/01 12:59:46 starting TCP server on [::]:9009
[info]  2021/10/01 12:59:46 starting TCP server on [::]:9011
[info]  2021/10/01 12:59:46 starting TCP server on [::]:9010
[info]  2021/10/01 12:59:46 starting TCP server on [::]:9012
[info]  2021/10/01 12:59:46 starting TCP server on [::]:9013

$ lsof -i :9009
COMMAND   PID     USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
main    31308 kallydev    5u  IPv6 0x786f75937d8c79db      0t0  TCP *:pichat (LISTEN)

@schollz
Copy link
Owner

schollz commented Oct 2, 2021

looks great!!! so cool, thanks

@schollz schollz merged commit d77c83c into schollz:master Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Relay binds only to v6 addresses
2 participants