Stream: jsCoq

Topic: P2P collab mode seems broken?


view this post on Zulip Emilio Jesús Gallego Arias (Sep 14 2022 at 10:57):

Hi, I think we broke the p2p system with the recent changes, now using the ?p2p=foo parameter in Chrome we get:

Uncaught (in promise) Error: unable to detect editor (got: 'Aa'
    at x.createEditorAdapter (27.collab.browser.js:2:1022175)
    at new x (27.collab.browser.js:2:1021734)
    at new Et (27.collab.browser.js:2:1043926)
    at f.setup (collab.browser.js:2:129636)
    at async f.open (collab.browser.js:2:130174)
collab.browser.js:2 Uncaught TypeError: Cannot read properties of undefined (reading 'new')
    at p.newDoc (collab.browser.js:2:131662)
    at HTMLButtonElement.<anonymous> (collab.browser.js:2:132052)
    at HTMLButtonElement.dispatch (collab.browser.js:2:70122)
    at m.handle (collab.browser.js:2:68117)

view this post on Zulip Shachar Itzhaky (Sep 15 2022 at 17:00):

oh seems you've built your bundle with minifications (webpack --mode production), so it changed all the names

view this post on Zulip Emilio Jesús Gallego Arias (Sep 16 2022 at 20:44):

I was using the one at https://coq-next.vercel.app/scratchpad.html?p2p=jscoq%2Fdemo-1

view this post on Zulip Shachar Itzhaky (Sep 27 2022 at 09:21):

Perhaps is would be wise to have a less brittle setup for the P2P handshake. My problem was that I was using a no-ip free domain routing to my home computer, and checkpoint firewalls block these domains via dns. So I had to send my Internet IP to clients but ofc that IP keeps changing. Do you have a reliable point where you can run this code in jscoq.wiki domain?

https://github.com/corwin-of-amber/Web.P2P.Dat/tree/master/subsidiaries/webrtc-hub

This runs a STUN/TURN server which is used for connection negotiation when the clients cannot see each other, and in cases of severe security restrictions (university network firewalls unfortunately) will act as a relay, so in these cases traffic will actually go through the server which is a shame. So a reasonably stable connection is preferred.

The STUN/TURN server runs on port 3487. This hub.js also runs a signaling server on port 3300, which I'm currently already running on https://pl.cs.technion.ac.il/wh, so that's not actually needed. We can try running the signaling and STUN/TURN on the same server, but that requires an SSL certificate.

view this post on Zulip Emilio Jesús Gallego Arias (Sep 27 2022 at 10:46):

Sure we can have this running on my own server which has a static IP. Tho I was wondering if we could use some free server for this?

I had a look to yjs, and unfortunately I don't know enough to fully understand what they do, but my understanding is that:

view this post on Zulip Shachar Itzhaky (Sep 27 2022 at 11:15):

I should definitely check yjs. I think we already saw them a long while ago but at that point it was not really working, looks like they have improved a lot. I will see what servers they use, although my understanding is that free signaling servers tend to be short-lived and free TURN servers are virtually nonexistent. Still we can use their library and signaling server and only run our own TURN for bypassing firewalls.

view this post on Zulip Emilio Jesús Gallego Arias (Sep 27 2022 at 12:39):

I was just interested in the free signalling part, but indeed if the servers are short-lived then it won't help.

There are some lists here https://gist.github.com/sagivo/3a4b2f2c7ac6e1b5267c2f1f59ac6c6b

view this post on Zulip Emilio Jesús Gallego Arias (Sep 27 2022 at 12:39):

I ignore if that is what you need in p2p-collab

view this post on Zulip Emilio Jesús Gallego Arias (Sep 27 2022 at 12:40):

There are some others that seem also free https://www.metered.ca/tools/openrelay/

view this post on Zulip Shachar Itzhaky (Sep 27 2022 at 13:00):

ok the openrelay projects seems like a trustable source. will try it

view this post on Zulip Shachar Itzhaky (Sep 27 2022 at 13:01):

they say it supports tcp too which is good as some firewalls block all udp, it's crazy out there

view this post on Zulip Emilio Jesús Gallego Arias (Sep 27 2022 at 13:42):

Cool. I was thinking about this a bit more, if we need to run our own relay that'd be fine in the short term, but would need to find resources to maintain it properly, not sure about the security implications of having such a relay.

view this post on Zulip Emilio Jesús Gallego Arias (Sep 27 2022 at 13:43):

Not sure either what is the inria policy for that kind of services.

view this post on Zulip Shachar Itzhaky (Sep 27 2022 at 14:01):

yeah it's a tricky thing. on one hand you want to have a relay that's only used by your app, on the other you don't want to force your users to create accounts and/or authenticate with oauth, so all the auth info must be contained within the app script. not much can be done to get around that.

view this post on Zulip Emilio Jesús Gallego Arias (Sep 27 2022 at 22:21):

Yes; tho I'm a bit lost with all this stuff :D If the free servers don't work for us I'll be happy to setup them in jscoq.wiki.


Last updated: May 31 2023 at 10:01 UTC