yjs / y-websocket

Websocket Connector for Yjs
https://docs.yjs.dev/ecosystem/connection-provider/y-websocket
MIT License
497 stars 256 forks source link

Unable to run demo #15

Closed amilich closed 4 years ago

amilich commented 4 years ago

Hi! Sorry if this isn't the right place to ask... I'm trying to run the y-websockets-server locally and can't seem to get the client to work. I cloned this repo as well as the demo repo, and I run PORT=1234 npx y-websockets-server, which results in an output of:

Running y-websockets-server on port 1234

In my client demo, I create a connection with:

const provider = new WebsocketProvider('ws://localhost:1234', 'my-roomname', ydoc)

I don't see a connection occur. Any ideas why?

Huly®: YJS-482

amilich commented 4 years ago

Actually, the above was the output when running this old server.

When running PORT=1234 npx y-websockets-server, the output is:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/y-websocket-server - Not found
npm ERR! 404 
npm ERR! 404  'y-websocket-server@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
dmonad commented 4 years ago

Hi @amilich , The server is now part of y-websocket. You should be able to run npx y-websocket-server after installing y-websocket. You should try to remove y-websockets-server from your system. Apparently it is still somehow referenced.