Skip to content

Allow listening to all interfaces instead of just localhost #7

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

Merged

Conversation

eventengineering
Copy link

When specifying no interface, use nil to allow for listening on all interfaces instead of just localhost.

@phillbaker
Copy link
Collaborator

Hm, can you give some more context here? If it's listening on all interfaces is than an unexpected change in the library?

@eventengineering
Copy link
Author

Documentation states if no interface (host) specified, then listen to all (often represented by "0.0.0.0")

If host is omitted, the server will accept connections on the unspecified IPv6 address (::) when IPv6 is available, or the unspecified IPv4 address (0.0.0.0) otherwise.
Net server listen

"localhost" is not the same as "0.0.0.0"

You may also use the special strings “localhost” or “loopback” to specify that the socket only accept connections from the local machine.
GCDAsyncSocket

In order to represent "0.0.0.0" correctly, it should be set to nil

To accept connections on any interface pass nil
GCDAsyncSocket

Copy link
Collaborator

@phillbaker phillbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@phillbaker phillbaker merged commit c29cf0f into aprock:master Oct 6, 2019
Rapsssito pushed a commit to Rapsssito/react-native-tcp-socket that referenced this pull request Oct 11, 2019
goodbright2014 pushed a commit to goodbright2014/react-native-tcp-ip that referenced this pull request Dec 14, 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.

3 participants