You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, when trying to create a TCP server with this code:
server.listen({port: 1234,host: '0.0.0.0'})
... it ends up rejecting all connections from other devices. I also tried leaving out the host option, but there's a default of 0.0.0.0 in TcpServer.js:70 so it's the same result...
Looking at the native code, this line here converts the address 0.0.0.0 to localhost which seems wrong , since localhost would prevent outside connections... If I change it to null rather, it works correctly, same as on android...
Using nil seems correct, since the headers for CocoaAsyncSocket say this:
The interface may be specified by name (e.g. "en1" or "lo0") or by IP address (e.g. "192.168.4.34").
You may also use the special strings "localhost" or "loopback" to specify that
the socket only accept connections from the local machine.
To accept connections on any interface pass nil, or simply use the acceptOnPort:error: method.
This is probably also the cause of these other related issues: #78#72
The text was updated successfully, but these errors were encountered:
Hi, when trying to create a TCP server with this code:
... it ends up rejecting all connections from other devices. I also tried leaving out the
host
option, but there's a default of0.0.0.0
in TcpServer.js:70 so it's the same result...Looking at the native code, this line here converts the address
0.0.0.0
tolocalhost
which seems wrong , since localhost would prevent outside connections... If I change it to null rather, it works correctly, same as on android...react-native-tcp/ios/TcpSocketClient.m
Lines 124 to 127 in b056904
... change to ...
Using
nil
seems correct, since the headers for CocoaAsyncSocket say this:This is probably also the cause of these other related issues: #78 #72
The text was updated successfully, but these errors were encountered: