Question

Bug in Docker websocket, probably nginx related, works in VPS

Brief

I’ve isolated a bug or problem with how a docker app can (not) use websockets. The error is probably being printed from nginx (according to my smart friend).

Example Error in LogStream:

('78.158.237.146', 48389) - "WebSocket /" 403

Reproduction Steps:

  1. Create a free/paid docker app
  2. Set the repo slug to zackees/webtorrent-seeder-websocket-bug
  3. When the app is built, go to the website at /
  4. Drag and drop an *.mp4 file into the upload form and submit
  5. Wait for the file to upload, the return value on the form will be the magnetURI, which will always be this: magnet:?xt=urn:btih:94993a31534e1a8466230e27be4ab1a5767eb8b5&dn=beavis_and_butthead.mp4&tr=wss%3A%2F%2Fwebtorrent-tracker.onrender.com
  6. Once the upload is finished, a webtorrent seed will be started on the backend, which will signal to the tracker that it is ready to serve the video. The swarm will be notified and you can check whether you can now download video by clicking here.
  7. If everything works correctly then the beavis and butthead clip should load.
  8. To debug the stream (a bit more) try out the webtorrent file checker

This is what it should look like is everything works correctly:

image|578x500

Works on a VPS

Surprisingly, the following command works just fine on a raw VPS: webtorrent-hybrid seed beavis_and_butthead.mp4 --keep-seeding --announce wss://webtorrent-tracker.onrender.com --port 80

Install it with:

  1. git clone https://github.com/zackees/webtorrent-seeder-websocket-bug
  2. npm install -g node-gyp-build
  3. npm install -g https://github.com/zackees/webtorrent-hybrid
  4. cd webtorrent-seeder-websocket-bug
  5. webtorrent-hybrid seed beavis_and_butthead.mp4 --keep-seeding --announce wss://webtorrent-tracker.onrender.com --port 80
  6. The swarm will be notified and you can check whether you can now download video by clicking here.

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer