pfertyk / webrtc-working-example

Tested on local and public network.
The Unlicense
154 stars 62 forks source link

Does not appear to work #8

Closed shurik closed 3 years ago

shurik commented 3 years ago

Hello,

Thank you for the blog post and this repo. I've tried to follow the post and tried using this repo with docker-compose. Unfortunately in both cases I've ended up with a blank screen and errors in browser console like:

GET /socket.io/?EIO=3&transport=polling&t=NQn5egf 404

Seems like the JS script is attempting to access /socket.io/ on the Python socket server. I can't seem to figure out how or why.

csik commented 3 years ago

Hi Shurik,

I had the same problem; I haven't done anything with the docker file but locally (not docker) in a python3.9 virtualenv I upgraded:

This gives me a blank firefox page asking for permissions; when I open another firefox page, then things seem to work. Be sure to hard-reload your pages.

I similarly fixed the docker implementation for myself; I have a fork that should show how I modified the Dockerfile in signaling: https://github.com/csik/webrtc-working-example

@pfertyk I'm not doing a pull request because I don't fully understand what was wrong with the handshakes and versions, but hopefully this can give you a clue.

pfertyk commented 3 years ago

Hi @shurik and @csik !

Thanks for reporting this issue. I believe I've found a solution. This example uses an old version of socket.io.js client, because React Native had some problems with newer versions. Possibly those problems have been solved already, but I didn't have the time to look into this, so for now I decided to stick to the old version. According to this comment on GitHub, that old version of socket.io client (2.x) requires Engine.IO version 3.x and python-socketio version 4.x:

https://github.com/miguelgrinberg/python-socketio/issues/578#issuecomment-740528415

However, python-socketio package has a newer dependency of python-engineio available, and if left unsupervised, will install 4.0.0. By specifying python-engineio version as 3.9.0 in signaling/requirements.txt this can be fixed:

aiohttp==3.6.2
python-socketio==4.5.0
python-engineio==3.9.0

This solved the issue on my machine. Could you confirm on yours?

pfertyk commented 3 years ago

There was a bit of inactivity regarding this task, so I merged the PR ;)