Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find one or more recommendable self-hosted WebRTC signaling servers #4

Open
bollwyvl opened this issue Apr 19, 2022 · 1 comment
Open
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@bollwyvl
Copy link
Contributor

Problem

Anyhow, what I haven't explored yet is a simple, self-hosted signaling server to recommend, e.g. as a jupyterhub service: relying on unmirrorable, public/free services at runtime is always shady, I think it would be a good solution for many use cases, already, over a user sharing the jupyter_server instance 😱.

from jupyterlite/jupyterlite#598 (comment)

Suggested Improvement

  • find a simple, recommendable signaling server
    • at best, a pure python server
    • at worst, packaged on conda-forge
  • add docs
  • add to binder
  • use in tests
@bollwyvl bollwyvl added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 19, 2022
@knoxell
Copy link

knoxell commented Dec 8, 2023

I came across this problem some time ago and started using the y-webrtc-signaling 'binary' from y-webrtc.

The y-webrtc-signaling source file bin/server.js should also give anyone wanting to implement the signaling server in python a good starting point.

Running a signaling server using nodejs

1. Setup the signaling server

For anyone wanting to give it a go, you need nodejs and npm and than just run in a directory where npm can install your project

# install y-webrtc package into your current folder
$ npm i y-webrtc
$ PORT=4444 npx y-webrtc-signaling
Signaling server running on localhost: 4444

It says running on localhost, but it's actually listening on 0.0.0.0, meaning it's listening on all network interfaces, so all the IPs your machine has.

2. Configure jupyterlite (running jupyterlab-webrtc-docprovider)

2.1 Configure jupyterlite manually use your signaling server

In Jupyter do:

  1. click on Settings
  2. click on Settings Editor/Advanced Settings Editor
  3. scroll to the bottom of the list to WebRTC Sharing and click on it
  4. under Signaling URLs choose custom signaling servers
  5. click on Add
  6. enter ws://YOUR_IP_OR_HOSTNAME:4444

2.2 Configure jupyterlite to automatically use your signaling server

put the following in your overrides.json

{
    "@jupyterlite/webrtc-docprovider:plugin": {
        "signalingUrls": [
            "ws://YOUR_IP_OR_HOSTNAME:4444"
        ]
    }
}

Notes

Your signaling server can run under localhost/127.0.0.1 (YOUR_IP_OR_HOSTNAME), but your jupiterlite cant (I don't know why, probably part of the webrtc security model..). For local testing I just run both on 127.0.0.10, because my local ip changes a lot.

This setup is just for testing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants