when I try to connect to the server from yjs/y-websocket provider, the connection fails because there’s a document name appended to the end of the server name e.g. wss://server.com/doc_name_here. It looks like the server-side code is outdated, because the same client can connect to the test instance: wss://demos.yjs.dev and wss://demos.yjs.dev/doc_name_here works
The y-websockets-server was last updated on April 7, 2018 ~ 3 years ago.
I wonder if there’s updated version somewhere. I started migrating the server to socket.io@3.1.1, but ran into further protocol issues.
btw, one of the reasons I missed the server code originally (apart from just not reading the docs enough): I skimmed the readme here: yjs/y-websocket and read the titles “Client Code” “API” and was skimming to find “Server Code” section, but it was named “WebSocket Server” instead. Also I’m used for the API/reference sections to be last in the readme. For those two reasons, I missed noticing the “WebSocket server” section 2-3 times (and ultimately went for the legacy code). I propose rename https://github.com/yjs/y-websocket#websocket-server to “Server Code” instead and move it before API. It’s a small change but I believe will significantly reduce time for people to find the right code.
That’s really helpful! I added information about the server to the top of the section (in the quick start section).
I see your point that the API section shouldn’t come at the beginning. But I prefer the current order because the API section is more relevant than the server-configuration IMO.