uProxy-p2p icon indicating copy to clipboard operation
uProxy-p2p copied to clipboard

2nd batch of socks requests could not go through

Open quantsword opened this issue 12 years ago • 6 comments

Configure firefox to use local socks5 server as provided by uproxy-networking, chromeapp. Visit a website, all the elements embedded in the page will be downloaded correctly. Wait a while and visit another page,

Log shows client to socks connections established, but nothing else will happen.

quantsword avatar Aug 27 '14 20:08 quantsword

I have a guess what might have happened. Still need some time to get familiar with the code.

When socks5 server is originally setup, it expect the first request to be "AuthHandshake". From then on, future handler is set to deal "RequestHandshake". When time between 2 session is long enough, this assumption is no longer true. Client will need to do "AuthHandshake".

quantsword avatar Aug 27 '14 21:08 quantsword

The problem seems in peer connection through webrtc. Data is sent to rtc channel, but onDataFromPeer_ was not triggered after the "timeout". Are we assuming webrtc channel will be available forever?

quantsword avatar Aug 28 '14 00:08 quantsword

I tried this on chrome v38. It is getting worse. There seems to be another issue in v38. The peer connection (actually data channel) could be closed before its data reaches the destination.

quantsword avatar Aug 28 '14 20:08 quantsword

The log of one such channel to show this behavior. *[uproxy-peerconnection-freedom-wrapper](7/28 13:57:14.264) E: !!! open data channel c214 logging.ts:78 *[PeerConnection](7/28 13:57:14.265) D: socksRtc: openDataChannel: c214; options=undefined logging.ts:74 *[PeerConnection](7/28 13:57:14.909) D: rtcNet: onPeerStartedDataChannel: c214 logging.ts:74 *[uproxy-peerconnection-freedom-wrapper](7/28 13:57:15.345) E: !!! send to data channel c214 logging.ts:78 *[DataChannel](7/28 13:57:15.446) E: !!! (c214) received message {"ports":[],"data":"{"version":5,"command":1,"destination":{"addressType":3,"endpoint":{"address":"clients1.google.com","port":80},"addressByteLength":23}}","source":null,"lastEventId":"","origin":"","path":{"length":0},"cancelBubble":false,"returnValue":true,"srcElement":{"binaryType":"arraybuffer","bufferedAmount":0,"readyState":"open","id":271,"negotiated":false,"protocol":"","maxRetransmits":65535,"maxRetransmitTime":65535,"ordered":true,"reliable":true,"label":"c214"},"defaultPrevented":false,"timeStamp":1409259435444,"cancelable":false,"bubbles":false,"eventPhase":2,"currentTarget":{"binaryType":"arraybuffer","bufferedAmount":0,"readyState":"open","id":271,"negotiated":false,"protocol":"","maxRetransmits":65535,"maxRetransmitTime":65535,"ordered":true,"reliable":true,"label":"c214"},"target":{"binaryType":"arraybuffer","bufferedAmount":0,"readyState":"open","id":271,"negotiated":false,"protocol":"","maxRetransmits":65535,"maxRetransmitTime":65535,"ordered":true,"reliable":true,"label":"c214"},"type":"message"} logging.ts:78 *[RtcToNet](7/28 13:57:15.494) D: onDataFromPeer_: {"channelLabel":"c214","message":{"str":"{"version":5,"command":1,"destination":{"addressType":3,"endpoint":{"address":"clients1.google.com","port":80},"addressByteLength":23}}"}} logging.ts:74 *[uproxy-peerconnection-freedom-wrapper](7/28 13:57:16.414) E: !!! send to data channel c214 logging.ts:78 *[RtcToNet](7/28 13:57:16.418) I: c214.o-N351.o: Connected to {"address":"74.125.225.197","port":80} logging.ts:74 *[DataChannel](7/28 13:57:16.484) E: !!! (c214) received message {"ports":[],"data":"{"address":"74.125.225.197","port":80}","source":null,"lastEventId":"","origin":"","path":{"length":0},"cancelBubble":false,"returnValue":true,"srcElement":{"binaryType":"arraybuffer","bufferedAmount":0,"readyState":"open","id":271,"negotiated":false,"protocol":"","maxRetransmits":65535,"maxRetransmitTime":65535,"ordered":true,"reliable":true,"label":"c214"},"defaultPrevented":false,"timeStamp":1409259436475,"cancelable":false,"bubbles":false,"eventPhase":2,"currentTarget":{"binaryType":"arraybuffer","bufferedAmount":0,"readyState":"open","id":271,"negotiated":false,"protocol":"","maxRetransmits":65535,"maxRetransmitTime":65535,"ordered":true,"reliable":true,"label":"c214"},"target":{"binaryType":"arraybuffer","bufferedAmount":0,"readyState":"open","id":271,"negotiated":false,"protocol":"","maxRetransmits":65535,"maxRetransmitTime":65535,"ordered":true,"reliable":true,"label":"c214"},"type":"message"} logging.ts:78 *[SocksToRtc](7/28 13:57:16.500) D: onDataFromPeer_: {"channelLabel":"c214","message":{"str":"{"address":"74.125.225.197","port":80}"}} logging.ts:74 *[SocksToRtc](7/28 13:57:21.542) D: N346.A756.c-c214.o: close logging.ts:74 *[uproxy-peerconnection-freedom-wrapper](7/28 13:57:21.544) E: !!! send to data channel c214 logging.ts:78 *[uproxy-peerconnection-freedom-wrapper](7/28 13:57:21.554) E: !!! close data channel c214 logging.ts:78 *[SocksToRtc](7/28 13:57:21.571) D: N346.A756.c-c214.c: close logging.ts:74 *[DataChannel](7/28 13:57:21.575) E: !!! (c214) received message {"ports":[],"data":"close","source":null,"lastEventId":"","origin":"","path":{"length":0},"cancelBubble":false,"returnValue":true,"srcElement":{"binaryType":"arraybuffer","bufferedAmount":0,"readyState":"closed","id":271,"negotiated":false,"protocol":"","maxRetransmits":65535,"maxRetransmitTime":65535,"ordered":true,"reliable":true,"label":"c214"},"defaultPrevented":false,"timeStamp":1409259441565,"cancelable":false,"bubbles":false,"eventPhase":2,"currentTarget":{"binaryType":"arraybuffer","bufferedAmount":0,"readyState":"closed","id":271,"negotiated":false,"protocol":"","maxRetransmits":65535,"maxRetransmitTime":65535,"ordered":true,"reliable":true,"label":"c214"},"target":{"binaryType":"arraybuffer","bufferedAmount":0,"readyState":"closed","id":271,"negotiated":false,"protocol":"","maxRetransmits":65535,"maxRetransmitTime":65535,"ordered":true,"reliable":true,"label":"c214"},"type":"message"} logging.ts:78 *[RtcToNet](7/28 13:57:21.605) D: onDataFromPeer_: {"channelLabel":"c214","message":{"str":"close"}} logging.ts:74 *[uproxy-peerconnection-freedom-wrapper](7/28 13:57:21.606) E: !!! close data channel c214 logging.ts:78 *[uproxy-peerconnection-freedom-wrapper](7/28 13:57:21.607) E: close non-existing dataChannel c214 logging.ts:78 *[RtcToNet](7/28 13:57:21.609) D: c214.c-N351.o: onceClosed. logging.ts:74

quantsword avatar Aug 28 '14 21:08 quantsword

urg... we'd better get an integration test, ideally at the simplicity of chat or chat2 sample app in the webrtc directory. Then we can file an issue with Chrome/WebRTC.

Thanks for exploring it!

On Thu, Aug 28, 2014 at 4:46 PM, sword [email protected] wrote:

I tried this on chrome v38. It is getting worse. There seems to be another issue in v38. The peer connection (actually data channel) could be closed before its data reaches the destination.

— Reply to this email directly or view it on GitHub https://github.com/uProxy/uproxy/issues/356#issuecomment-53795638.

Lucas Dixon | Google Ideas

iislucas avatar Aug 28 '14 21:08 iislucas

OK, we figured this out - it was two interacting webrtc data channel bugs: you couldn't use the same ID twice; and webrtc was double-allocating IDs (so as soon as you close one channel your next open fails, but the one after that works. )

iislucas avatar Sep 09 '14 14:09 iislucas