nurdism / neko

A self hosted virtual browser (rabb.it clone) that runs in docker.
Apache License 2.0
2.03k stars 185 forks source link

[Firefox] InvalidAccessError: Answer tried to set recv when offer did not set send #2

Closed Jawastew closed 4 years ago

Jawastew commented 4 years ago

Hello there,

I ran neko through docker via

sudo docker run -p 8080:8080 -e NEKO_PASSWORD='secret' --shm-size=2gb nurdism/neko:latest 

on ubuntu:18.04 and can access the webpage just fine through Chrome(ium) but with Firefox I get following error in the console when trying to connect to the server after password entry:

InvalidAccessError: Answer tried to set recv when offer did not set send

After googling I came across the following:
https://stackoverflow.com/questions/35166456/jssip-firefox-invalidsessiondescriptionerror-answer-tried-to-set-recv-when-of

In https://github.com/nurdism/neko/blob/6f1a2bb77ab50bb2cb355b88c00232215ce42e55/client/src/App.vue#L516 you set the webrtc? connection to recv only, so I'm guessing there should be some equivalent flag you can set on the server.

From the Serverlogs:

9:07PM INF Attempting to upgrade ws service=webrtc
9:07PM INF Created Session ID=7tlabAq9HB9M7oXr0BX8fjvJ2kYfaZeI RemoteAddr=172.17.0.1:35866 service=webrtc

2020-01-14 21:07:57,259 DEBG 'neko' stdout output:
9:07PM INF Reading from Websocket ID=7tlabAq9HB9M7oXr0BX8fjvJ2kYfaZeI Message="{\"event\":\"sdp/provide\",\"sdp\":\"v=0\\r\\no=mozilla...THIS_IS_SDPARTA-70.0.1 509912544391959626 0 IN IP4 0.0.0.0\\r\\ns=-\\r\\nt=0 0\\r\\na=sendrecv\\r\\na=fingerprint:sha-256 A9:2B:5D:32:B4:B9:AC:7C:6F:4F:2A:84:8C:CC:7A:30:60:EE:62:41:61:AA:3A:44:17:02:09:86:2F:1C:0B:86\\r\\na=group:BUNDLE 0 1 2\\r\\na=ice-options:trickle\\r\\na=msid-semantic:WMS *\\r\\nm=audio 52277 UDP/TLS/RTP/SAVPF 109 9 0 8 101\\r\\nc=IN IP4 217.244.x.x\\r\\na=candidate:0 1 UDP 2122252543 192.168.x.x 52277 typ host\\r\\na=candidate:2 1 TCP 2105524479 192.168.x.x 9 typ host tcptype active\\r\\na=candidate:0 2 UDP 2122252542 192.168.x.x 33653 typ host\\r\\na=candidate:2 2 TCP 2105524478 192.168.x.x 9 typ host tcptype active\\r\\na=candidate:1 1 UDP 1686052863 217.244.x.x 52277 typ srflx raddr 192.168.x.x rport 52277\\r\\na=candidate:1 2 UDP 1686052862 217.244.x.x 33653 typ srflx raddr 192.168.x.x rport 33653\\r\\na=recvonly\\r\\na=end-of-candidates\\r\\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\\r\\na=extmap:2/recvonly urn:ietf:params:rtp-hdrext:csrc-audio-level\\r\\na=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid\\r\\na=fmtp:109 maxplaybackrate=48000;stereo=1;useinbandfec=1\\r\\na=fmtp:101 0-15\\r\\na=ice-pwd:3b4b87da2ab02d79fec157e771f64da4\\r\\na=ice-ufrag:b5e81f19\\r\\na=mid:0\\r\\na=rtcp:33653 IN IP4 217.244.x.x\\r\\na=rtcp-mux\\r\\na=rtpmap:109 opus/48000/2\\r\\na=rtpmap:9 G722/8000/1\\r\\na=rtpmap:0 PCMU/8000\\r\\na=rtpmap:8 PCMA/8000\\r\\na=rtpmap:101 telephone-event/8000\\r\\na=setup:actpass\\r\\na=ssrc:1163086180 cname:{5dd52bdf-9dbd-4345-8880-3cf811bb43df}\\r\\nm=video 33125 UDP/TLS/RTP/SAVPF 120 121 126 97\\r\\nc=IN IP4 217.244.x.x\\r\\na=candidate:0 1 UDP 2122252543 192.168.x.x 33125 typ host\\r\\na=candidate:2 1 TCP 2105524479 192.168.x.x 9 typ host tcptype active\\r\\na=candidate:0 2 UDP 2122252542 192.168.x.x 55861 typ host\\r\\na=candidate:2 2 TCP 2105524478 192.168.x.x 9 typ host tcptype active\\r\\na=candidate:1 1 UDP 1686052863 217.244.x.x 33125 typ srflx raddr 192.168.x.x rport 33125\\r\\na=candidate:1 2 UDP 1686052862 217.244.x.x 55861 typ srflx raddr 192.168.x.x rport 55861\\r\\na=recvonly\\r\\na=end-of-candidates\\r\\na=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid\\r\\na=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\\r\\na=extmap:5 urn:ietf:params:rtp-hdrext:toffset\\r\\na=fmtp:126 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1\\r\\na=fmtp:97 profile-level-id=42e01f;level-asymmetry-allowed=1\\r\\na=fmtp:120 max-fs=12288;max-fr=60\\r\\na=fmtp:121 max-fs=12288;max-fr=60\\r\\na=ice-pwd:3b4b87da2ab02d79fec157e771f64da4\\r\\na=ice-ufrag:b5e81f19\\r\\na=mid:1\\r\\na=rtcp:55861 IN IP4 217.244.x.x\\r\\na=rtcp-fb:120 nack\\r\\na=rtcp-fb:120 nack pli\\r\\na=rtcp-fb:120 ccm fir\\r\\na=rtcp-fb:120 goog-remb\\r\\na=rtcp-fb:121 nack\\r\\na=rtcp-fb:121 nack pli\\r\\na=rtcp-fb:121 ccm fir\\r\\na=rtcp-fb:121 goog-remb\\r\\na=rtcp-fb:126 nack\\r\\na=rtcp-fb:126 nack pli\\r\\na=rtcp-fb:126 ccm fir\\r\\na=rtcp-fb:126 goog-remb\\r\\na=rtcp-fb:97 nack\\r\\na=rtcp-fb:97 nack pli\\r\\na=rtcp-fb:97 ccm fir\\r\\na=rtcp-fb:97 goog-remb\\r\\na=rtcp-mux\\r\\na=rtpmap:120 VP8/90000\\r\\na=rtpmap:121 VP9/90000\\r\\na=rtpmap:126 H264/90000\\r\\na=rtpmap:97 H264/90000\\r\\na=setup:actpass\\r\\na=ssrc:957676235 cname:{5dd52bdf-9dbd-4345-8880-3cf811bb43df}\\r\\nm=application 37034 UDP/DTLS/SCTP webrtc-datachannel\\r\\nc=IN IP4 217.244.x.x\\r\\na=candidate:0 1 UDP 2122252543 192.168.x.x 37034 typ host\\r\\na=candidate:2 1 TCP 2105524479 192.168.x.x 9 typ host tcptype active\\r\\na=candidate:1 1 UDP 1686052863 217.244.x.x 37034 typ srflx raddr 192.168.x.x rport 37034\\r\\na=sendrecv\\r\\na=end-of-candidates\\r\\na=ice-pwd:3b4b87da2ab02d79fec157e771f64da4\\r\\na=ice-ufrag:b5e81f19\\r\\na=mid:2\\r\\na=setup:actpass\\r\\na=sctp-port:5000\\r\\na=max-message-size:1073741823\\r\\n\"}" service=webrtc

2020-01-14 21:08:07,334 DEBG 'neko' stdout output:
9:08PM INF Handle WS ending RemoteAddr=172.17.0.1:35866 service=webrtc
9:08PM ERR session.destroy has failed error="close tcp 172.17.0.2:8080->172.17.0.1:35866: use of closed network connection" service=webrtc

With the Websocket Message being:

{'event': 'sdp/provide',
 'sdp': 'v=0\r\n'
        'o=mozilla...THIS_IS_SDPARTA-70.0.1 509912544391959626 0 IN IP4 '
        '0.0.0.0\r\n'
        's=-\r\n'
        't=0 0\r\n'
        'a=sendrecv\r\n'
        'a=fingerprint:sha-256 '
        'A9:2B:5D:32:B4:B9:AC:7C:6F:4F:2A:84:8C:CC:7A:30:60:EE:62:41:61:AA:3A:44:17:02:09:86:2F:1C:0B:86\r\n'
        'a=group:BUNDLE 0 1 2\r\n'
        'a=ice-options:trickle\r\n'
        'a=msid-semantic:WMS *\r\n'
        'm=audio 52277 UDP/TLS/RTP/SAVPF 109 9 0 8 101\r\n'
        'c=IN IP4 217.244.x.x\r\n'
        'a=candidate:0 1 UDP 2122252543 192.168.x.x 52277 typ host\r\n'
        'a=candidate:2 1 TCP 2105524479 192.168.x.x 9 typ host tcptype '
        'active\r\n'
        'a=candidate:0 2 UDP 2122252542 192.168.x.x 33653 typ host\r\n'
        'a=candidate:2 2 TCP 2105524478 192.168.x.x 9 typ host tcptype '
        'active\r\n'
        'a=candidate:1 1 UDP 1686052863 217.244.x.x 52277 typ srflx raddr '
        '192.168.x.x rport 52277\r\n'
        'a=candidate:1 2 UDP 1686052862 217.244.x.x 33653 typ srflx raddr '
        '192.168.x.x rport 33653\r\n'
        'a=recvonly\r\n'
        'a=end-of-candidates\r\n'
        'a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\n'
        'a=extmap:2/recvonly urn:ietf:params:rtp-hdrext:csrc-audio-level\r\n'
        'a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid\r\n'
        'a=fmtp:109 maxplaybackrate=48000;stereo=1;useinbandfec=1\r\n'
        'a=fmtp:101 0-15\r\n'
        'a=ice-pwd:3b4b87da2ab02d79fec157e771f64da4\r\n'
        'a=ice-ufrag:b5e81f19\r\n'
        'a=mid:0\r\n'
        'a=rtcp:33653 IN IP4 217.244.x.x\r\n'
        'a=rtcp-mux\r\n'
        'a=rtpmap:109 opus/48000/2\r\n'
        'a=rtpmap:9 G722/8000/1\r\n'
        'a=rtpmap:0 PCMU/8000\r\n'
        'a=rtpmap:8 PCMA/8000\r\n'
        'a=rtpmap:101 telephone-event/8000\r\n'
        'a=setup:actpass\r\n'
        'a=ssrc:1163086180 cname:{5dd52bdf-9dbd-4345-8880-3cf811bb43df}\r\n'
        'm=video 33125 UDP/TLS/RTP/SAVPF 120 121 126 97\r\n'
        'c=IN IP4 217.244.x.x\r\n'
        'a=candidate:0 1 UDP 2122252543 192.168.x.x 33125 typ host\r\n'
        'a=candidate:2 1 TCP 2105524479 192.168.x.x 9 typ host tcptype '
        'active\r\n'
        'a=candidate:0 2 UDP 2122252542 192.168.x.x 55861 typ host\r\n'
        'a=candidate:2 2 TCP 2105524478 192.168.x.x 9 typ host tcptype '
        'active\r\n'
        'a=candidate:1 1 UDP 1686052863 217.244.x.x 33125 typ srflx raddr '
        '192.168.x.x rport 33125\r\n'
        'a=candidate:1 2 UDP 1686052862 217.244.x.x 55861 typ srflx raddr '
        '192.168.x.x rport 55861\r\n'
        'a=recvonly\r\n'
        'a=end-of-candidates\r\n'
        'a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid\r\n'
        'a=extmap:4 '
        'http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\n'
        'a=extmap:5 urn:ietf:params:rtp-hdrext:toffset\r\n'
        'a=fmtp:126 '
        'profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1\r\n'
        'a=fmtp:97 profile-level-id=42e01f;level-asymmetry-allowed=1\r\n'
        'a=fmtp:120 max-fs=12288;max-fr=60\r\n'
        'a=fmtp:121 max-fs=12288;max-fr=60\r\n'
        'a=ice-pwd:3b4b87da2ab02d79fec157e771f64da4\r\n'
        'a=ice-ufrag:b5e81f19\r\n'
        'a=mid:1\r\n'
        'a=rtcp:55861 IN IP4 217.244.x.x\r\n'
        'a=rtcp-fb:120 nack\r\n'
        'a=rtcp-fb:120 nack pli\r\n'
        'a=rtcp-fb:120 ccm fir\r\n'
        'a=rtcp-fb:120 goog-remb\r\n'
        'a=rtcp-fb:121 nack\r\n'
        'a=rtcp-fb:121 nack pli\r\n'
        'a=rtcp-fb:121 ccm fir\r\n'
        'a=rtcp-fb:121 goog-remb\r\n'
        'a=rtcp-fb:126 nack\r\n'
        'a=rtcp-fb:126 nack pli\r\n'
        'a=rtcp-fb:126 ccm fir\r\n'
        'a=rtcp-fb:126 goog-remb\r\n'
        'a=rtcp-fb:97 nack\r\n'
        'a=rtcp-fb:97 nack pli\r\n'
        'a=rtcp-fb:97 ccm fir\r\n'
        'a=rtcp-fb:97 goog-remb\r\n'
        'a=rtcp-mux\r\n'
        'a=rtpmap:120 VP8/90000\r\n'
        'a=rtpmap:121 VP9/90000\r\n'
        'a=rtpmap:126 H264/90000\r\n'
        'a=rtpmap:97 H264/90000\r\n'
        'a=setup:actpass\r\n'
        'a=ssrc:957676235 cname:{5dd52bdf-9dbd-4345-8880-3cf811bb43df}\r\n'
        'm=application 37034 UDP/DTLS/SCTP webrtc-datachannel\r\n'
        'c=IN IP4 217.244.x.x\r\n'
        'a=candidate:0 1 UDP 2122252543 192.168.x.x 37034 typ host\r\n'
        'a=candidate:2 1 TCP 2105524479 192.168.x.x 9 typ host tcptype '
        'active\r\n'
        'a=candidate:1 1 UDP 1686052863 217.244.x.x 37034 typ srflx raddr '
        '192.168.x.x rport 37034\r\n'
        'a=sendrecv\r\n'
        'a=end-of-candidates\r\n'
        'a=ice-pwd:3b4b87da2ab02d79fec157e771f64da4\r\n'
        'a=ice-ufrag:b5e81f19\r\n'
        'a=mid:2\r\n'
        'a=setup:actpass\r\n'
        'a=sctp-port:5000\r\n'
        'a=max-message-size:1073741823\r\n'}

Nice Project, from what I have tested so far :)

jinxmcg commented 4 years ago

I encountered the same issue. All good on Chrome. Here if you need testers.

JoiTD commented 4 years ago

I'm having the same problem, but it doesn't seem to matter which browser I'm using. EDIT: Error's only showing up when my client is on LTE