uproxy-networking, simple-socks demo, sometimes socks server stopped working
This behavior is very inconsistent, but happened to me several times. Every once a while, the socks server stopped responding. Neither firefox nor command line curl failed to work. But the behavior is different from no listening port on 9999. In that case, firefox will prompt failure message immediately. It seems like the socks5 handling code failed to respond.
I will put some debugging code in socks5 server code and see what could I find.
We're aware of a bunch of issues with the SOCKS proxy already and I think we already have an umbrella issue here: https://github.com/uProxy/uproxy/issues/388
More specific issues:
- https://github.com/uProxy/uproxy/issues/439
- https://github.com/uProxy/uproxy/issues/340
Note: #388 is not a socks5 issue, but a chrome webrtc one.
This happens to me again and I captured this log. It seems p2p connection failed to be established.
This appears to be Chrome adapter.js:126 WEBWORKER - SocksToRtc: blob:chrome-extension%3A//ankbjjfcgccmlbbmdgmkoapagkjbmaae/cdb76d1f-2a5d-4cf4-aa6e-2b1976902049#simple-socks socks-to-rtc.ts:15 WEBWORKER - RtcToNet: blob:chrome-extension%3A//ankbjjfcgccmlbbmdgmkoapagkjbmaae/cdb76d1f-2a5d-4cf4-aa6e-2b1976902049#simple-socks rtc-to-net.ts:16 *[uproxy-peerconnection-freedom-wrapper](9/9 11:52:53.275) D: making new pc from config: {"webrtcPcConfig":{"iceServers":[{"url":"stun:stun.l.google.com:19302"},{"url":"stun:stun1.l.google.com:19302"},{"url":"stun:stun2.l.google.com:19302"},{"url":"stun:stun3.l.google.com:19302"},{"url":"stun:stun4.l.google.com:19302"}]},"webrtcMediaConstraints":{"optional":[{"DtlsSrtpKeyAgreement":true}]},"peerName":"rtcNet"} logging.js:37 *[SocksToRtc](9/9 11:52:53.299) D: !!! began to setup peer connection. logging.js:37 *[uproxy-peerconnection-freedom-wrapper](9/9 11:52:53.301) D: making new pc from config: {"webrtcPcConfig":{"iceServers":[{"url":"stun:stun.l.google.com:19302"},{"url":"stun:stun1.l.google.com:19302"},{"url":"stun:stun2.l.google.com:19302"},{"url":"stun:stun3.l.google.com:19302"},{"url":"stun:stun4.l.google.com:19302"}]},"webrtcMediaConstraints":{"optional":[{"DtlsSrtpKeyAgreement":true}]},"peerName":"socksRtc"} logging.js:37 *[PeerConnection](9/9 11:52:53.305) D: socksRtc: openDataChannel: ; options=undefined logging.js:37 *[PeerConnection](9/9 11:52:53.331) D: socksRtc: negotiateConnection_ logging.js:37 *[PeerConnection](9/9 11:52:53.351) D: socksRtc: setLocalDescription logging.js:37 *[PeerConnection](9/9 11:52:53.358) D: rtcNet: handleSignalMessage: {"type":0,"description":{"type":"offer","sdp":"v=0\r\no=- 3360819109888032370 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio data\r\na=msid-semantic: WMS\r\nm=audio 1 RTP/SAVPF 111 103 104 0 8 106 105 13 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:b+XOdXI5YKoNDbOr\r\na=ice-pwd:fk7lpjSOCGpNYvHu8s3o5LzK\r\na=ice-options:google-ice\r\na=fingerprint:sha-256 6A:46:33:35:4A:6B:C1:54:E0:96:21:78:19:4E:B3:01:0C:6B:2A:A9:80:2E:92:1E:6B:80:C7:BA:1D:12:75:74\r\na=setup:actpass\r\na=mid:audio\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=recvonly\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:126 telephone-event/8000\r\na=maxptime:60\r\nm=application 1 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:b+XOdXI5YKoNDbOr\r\na=ice-pwd:fk7lpjSOCGpNYvHu8s3o5LzK\r\na=ice-options:google-ice\r\na=fingerprint:sha-256 6A:46:33:35:4A:6B:C1:54:E0:96:21:78:19:4E:B3:01:0C:6B:2A:A9:80:2E:92:1E:6B:80:C7:BA:1D:12:75:74\r\na=setup:actpass\r\na=mid:data\r\na=sctpmap:5000 webrtc-datachannel 1024\r\n"}} logging.js:37 *[PeerConnection](9/9 11:52:53.366) D: rtcNet: setRemoteDescription logging.js:37 *[PeerConnection](9/9 11:52:53.369) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:4286457359 1 udp 2122260223 10.1.10.21 50932 typ host generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.372) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:4286457359 2 udp 2122260223 10.1.10.21 50932 typ host generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.375) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:1002279090 1 udp 2122194687 169.254.83.6 59486 typ host generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.377) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:1002279090 2 udp 2122194687 169.254.83.6 59486 typ host generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.380) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:4286457359 1 udp 2122260223 10.1.10.21 50932 typ host generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.382) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:1002279090 1 udp 2122194687 169.254.83.6 59486 typ host generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.393) D: rtcNet: setLocalDescription logging.js:37 *[PeerConnection](9/9 11:52:53.399) D: socksRtc: handleSignalMessage: {"type":1,"description":{"type":"answer","sdp":"v=0\r\no=- 2895669760432650642 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio data\r\na=msid-semantic: WMS\r\nm=audio 1 RTP/SAVPF 111 103 104 0 8 106 105 13 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:NtTH/WuRIED1PbTT\r\na=ice-pwd:mhJYMNL+otQL4NaZvEc1svz8\r\na=fingerprint:sha-256 6A:46:33:35:4A:6B:C1:54:E0:96:21:78:19:4E:B3:01:0C:6B:2A:A9:80:2E:92:1E:6B:80:C7:BA:1D:12:75:74\r\na=setup:active\r\na=mid:audio\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=sendonly\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:126 telephone-event/8000\r\na=maxptime:60\r\nm=application 1 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\nb=AS:30\r\na=ice-ufrag:NtTH/WuRIED1PbTT\r\na=ice-pwd:mhJYMNL+otQL4NaZvEc1svz8\r\na=fingerprint:sha-256 6A:46:33:35:4A:6B:C1:54:E0:96:21:78:19:4E:B3:01:0C:6B:2A:A9:80:2E:92:1E:6B:80:C7:BA:1D:12:75:74\r\na=setup:active\r\na=mid:data\r\na=sctpmap:5000 webrtc-datachannel 1024\r\n"}} logging.js:37 *[PeerConnection](9/9 11:52:53.409) D: socksRtc: setRemoteDescription logging.js:37 *[PeerConnection](9/9 11:52:53.410) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:4286457359 1 udp 2122260223 10.1.10.21 51621 typ host generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.413) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:1002279090 1 udp 2122194687 169.254.83.6 49464 typ host generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.415) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:4286457359 1 udp 2122260223 10.1.10.21 51621 typ host generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.418) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:1002279090 1 udp 2122194687 169.254.83.6 49464 typ host generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.443) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 51621 typ srflx raddr 10.1.10.21 rport 51621 generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.446) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 51621 typ srflx raddr 10.1.10.21 rport 51621 generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.449) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 50932 typ srflx raddr 10.1.10.21 rport 50932 generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.453) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 50932 typ srflx raddr 10.1.10.21 rport 50932 generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.459) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:2986203903 1 tcp 1518280447 10.1.10.21 0 typ host tcptype active generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.461) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:1967025218 1 tcp 1518214911 169.254.83.6 0 typ host tcptype active generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.464) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:2986203903 1 tcp 1518280447 10.1.10.21 0 typ host tcptype active generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.467) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:1967025218 1 tcp 1518214911 169.254.83.6 0 typ host tcptype active generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.482) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 50932 typ srflx raddr 10.1.10.21 rport 50932 generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.485) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 50932 typ srflx raddr 10.1.10.21 rport 50932 generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.489) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 51621 typ srflx raddr 10.1.10.21 rport 51621 generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.492) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 51621 typ srflx raddr 10.1.10.21 rport 51621 generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.497) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:2986203903 1 tcp 1518280447 10.1.10.21 0 typ host tcptype active generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.501) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:1967025218 1 tcp 1518214911 169.254.83.6 0 typ host tcptype active generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.504) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:2986203903 1 tcp 1518280447 10.1.10.21 0 typ host tcptype active generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.508) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:1967025218 1 tcp 1518214911 169.254.83.6 0 typ host tcptype active generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.517) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 50932 typ srflx raddr 10.1.10.21 rport 50932 generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.520) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 50932 typ srflx raddr 10.1.10.21 rport 50932 generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.523) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 51621 typ srflx raddr 10.1.10.21 rport 51621 generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.526) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 51621 typ srflx raddr 10.1.10.21 rport 51621 generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.566) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607x.x.x.x 51621 typ srflx raddr 10.1.10.21 rport 51621 generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.569) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 51621 typ srflx raddr 10.1.10.21 rport 51621 generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.572) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 50932 typ srflx raddr 10.1.10.21 rport 50932 generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.575) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 50932 typ srflx raddr 10.1.10.21 rport 50932 generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.579) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 50932 typ srflx raddr 10.1.10.21 rport 50932 generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.583) D: rtcNet: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 50932 typ srflx raddr 10.1.10.21 rport 50932 generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:52:53.586) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 51621 typ srflx raddr 10.1.10.21 rport 51621 generation 0","sdpMid":"audio","sdpMLineIndex":0}} logging.js:37 *[PeerConnection](9/9 11:52:53.588) D: socksRtc: handleSignalMessage: {"type":2,"candidate":{"candidate":"candidate:476029155 1 udp 1686052607 x.x.x.x 51621 typ srflx raddr 10.1.10.21 rport 51621 generation 0","sdpMid":"data","sdpMLineIndex":1}} logging.js:37 *[PeerConnection](9/9 11:53:2.917) D: rtcNet: handleSignalMessage: {"type":3} logging.js:37 *[PeerConnection](9/9 11:53:2.919) D: rtcNet: handleSignalMessage: noMoreCandidates logging.js:37 *[PeerConnection](9/9 11:53:2.920) D: socksRtc: handleSignalMessage: {"type":3} logging.js:37 *[PeerConnection](9/9 11:53:2.921) D: socksRtc: handleSignalMessage: noMoreCandidates logging.js:37 *[Tcp](9/9 11:53:50.65) D: Tcp.Server accepted connection on socket id 8533 logging.js:37 *[Tcp](9/9 11:53:50.69) D: Tcp.Server({"address":"127.0.0.1","port":9999}) connections: 1 logging.js:37 *[PeerConnection](9/9 11:53:50.70) D: socksRtc: openDataChannel: c0; options=undefined logging.js:37 Unpaused receiver tcpsocket.js:19 *[Tcp](9/9 11:53:50.86) D: N0.A8533 received data (3 bytes) from socket, push to queue. logging.js:37 !!! authorization handshake. socks-headers.ts:91 *[Tcp](9/9 11:53:50.89) D: !!! Pass 2 bytes data to socket N0.A8533 logging.js:37 *[Tcp](9/9 11:53:50.109) D: N0.A8533 received data (18 bytes) from socket, push to queue. logging.js:37 *[Tcp](9/9 11:53:50.294) D: Tcp.Server accepted connection on socket id 8534 logging.js:37 *[Tcp](9/9 11:53:50.297) D: Tcp.Server({"address":"127.0.0.1","port":9999}) connections: 2 logging.js:37 *[PeerConnection](9/9 11:53:50.299) D: socksRtc: openDataChannel: c1; options=undefined logging.js:37 Unpaused receiver tcpsocket.js:19 *[Tcp](9/9 11:53:50.318) D: N1.A8534 received data (3 bytes) from socket, push to queue. logging.js:37 !!! authorization handshake. socks-headers.ts:91 *[Tcp](9/9 11:53:50.320) D: !!! Pass 2 bytes data to socket N1.A8534 logging.js:37 *[Tcp](9/9 11:53:50.340) D: N1.A8534 received data (18 bytes) from socket, push to queue. logging.js:37 *[Tcp](9/9 11:55:20.108) D: N1.A8534: onDisconnectHandler_ logging.js:37 *[Tcp](9/9 11:55:20.110) D: Tcp.Server({"address":"127.0.0.1","port":9999}) : connection closed (8534). Conn Count: 1] logging.js:37 *[SocksToRtc](9/9 11:55:20.113) D: N1.A8534.c-c1.o: close logging.js:37 *[Tcp](9/9 11:55:20.118) D: N0.A8533: onDisconnectHandler_ logging.js:37 *[Tcp](9/9 11:55:20.120) D: Tcp.Server({"address":"127.0.0.1","port":9999}) : connection closed (8533). Conn Count: 0] logging.js:37 *[SocksToRtc](9/9 11:55:20.121) D: N0.A8533.c-c0.o: close logging.js:37 *[SocksToRtc](9/9 11:55:20.126) D: N1.A8534.c-c1.c: close logging.js:37 *[SocksToRtc](9/9 11:55:20.129) D: N0.A8533.c-c0.c: close logging.js:37 *[Tcp](9/9 11:55:20.175) D: Tcp.Server accepted connection on socket id 8535 logging.js:37 *[Tcp](9/9 11:55:20.181) D: Tcp.Server({"address":"127.0.0.1","port":9999}) connections: 1 logging.js:37 *[PeerConnection](9/9 11:55:20.184) D: socksRtc: openDataChannel: c2; options=undefined logging.js:37 Unpaused receiver tcpsocket.js:19 *[Tcp](9/9 11:55:20.188) D: N2.A8535 received data (3 bytes) from socket, push to queue. logging.js:37 !!! authorization handshake. socks-headers.ts:91 *[Tcp](9/9 11:55:20.190) D: !!! Pass 2 bytes data to socket N2.A8535 logging.js:37 *[Tcp](9/9 11:55:20.234) D: N2.A8535 received data (18 bytes) from socket, push to queue. logging.js:37 *[Tcp](9/9 11:55:20.364) D: Tcp.Server accepted connection on socket id 8536 logging.js:37 *[Tcp](9/9 11:55:20.368) D: Tcp.Server({"address":"127.0.0.1","port":9999}) connections: 2 logging.js:37 *[PeerConnection](9/9 11:55:20.370) D: socksRtc: openDataChannel: c3; options=undefined logging.js:37 Unpaused receiver tcpsocket.js:19 *[Tcp](9/9 11:55:20.394) D: N3.A8536 received data (3 bytes) from socket, push to queue. logging.js:37 !!! authorization handshake. socks-headers.ts:91 *[Tcp](9/9 11:55:20.396) D: !!! Pass 2 bytes data to socket N3.A8536 logging.js:37 *[Tcp](9/9 11:55:20.423) D: N3.A8536 received data (18 bytes) from socket, push to queue. logging.js:37 *[Tcp](9/9 11:56:50.171) D: N3.A8536: onDisconnectHandler_ logging.js:37 *[Tcp](9/9 11:56:50.173) D: Tcp.Server({"address":"127.0.0.1","port":9999}) : connection closed (8536). Conn Count: 1] logging.js:37 *[SocksToRtc](9/9 11:56:50.181) D: N3.A8536.c-c3.o: close logging.js:37 *[Tcp](9/9 11:56:50.183) D: N2.A8535: onDisconnectHandler_ logging.js:37 *[Tcp](9/9 11:56:50.184) D: Tcp.Server({"address":"127.0.0.1","port":9999}) : connection closed (8535). Conn Count: 0] logging.js:37 *[SocksToRtc](9/9 11:56:50.186) D: N2.A8535.c-c2.o: close logging.js:37 *[SocksToRtc](9/9 11:56:50.191) D: N3.A8536.c-c3.c: close logging.js:37 *[SocksToRtc](9/9 11:56:50.193) D: N2.A8535.c-c2.c: close logging.js:37
Lucas suggested that on Mac, firewall setting, especially enable/disable "all incoming connection" might have something to do with this behavior. That does make the difference on my MAC. With a single network connection, it worked most of the time if I allow incoming connection. Otherwise it does not work. For the rare case when enable incoming connection still fails, it might be caused by other issues. When I disable incoming connection, the NAT detection tool still report NAT type to be port restricted cone. That means, at least theoretically, Chrome should be able to establish p2p connection.
When Ben tested this, the aberrational behavior we noticed was that if a udp socket was created, and then incoming messages were sent to the bound port, they were discarded by the firewall as intended. If, subsequently, the socket then attempted to send messages back to the source of those discarded messages, the send system call also failed.
Maybe this is something uProbe could attempt to characterize? Is it testing that sequence of events already?
On Thu Oct 09 2014 at 5:40:22 PM sword [email protected] wrote:
Lucas suggested that on Mac, firewall setting, especially enable/disable "all incoming connection" might have something to do with this behavior. That does make the difference on my MAC. With a single network connection, it worked most of the time if I allow incoming connection. Otherwise it does not work. For the rare case when enable incoming connection still fails, it might be caused by other issues. When I disable incoming connection, the NAT detection tool still report NAT type to be port restricted cone. That means, at least theoretically, Chrome should be able to establish p2p connection.
— Reply to this email directly or view it on GitHub https://github.com/uProxy/uproxy/issues/451#issuecomment-58582272.
I tried to capture the package on the same machine using wireshark. Here is what I saw. When firewall setting turn on "disable all incoming connection", Stun request to find local binding returned successfully. But local ip (10.1.10.21) to wan ip is rejected with ICMP message.
When firewall setting turned off "disable all incoming connections", no traffic between local ip and wan ip can be observed at all. From uproxy log, it seems the connection is established with localhost ip (127.0.0.1).
I happen to have 2 different router. I switched to the other router and turned on "disable all incoming connection", this time p2p connection can be established again. In wireshark, I could see request from local ip (192.168.4.x) to wan ip was no longer rejected, and it is being forwarded correctly.
Conclusions:
- "disable all incoming connection" setting on mac OSX will break p2p connection within localhost.
- Some router refuse to forward traffic from local ip back to local ip.
These behavior might not be typical for real world users, but could cause enough confusion for our own test.