Comments (9)
I don't think this is possible atm as native websocket clients are not able to connect to socket.io servers and vice versa, thus y-websocket had to be rewritten using socket.io. (And most likely the complete core of hocuspocus too)
As most browsers (> 97%) support native websockets I don't think the huge amount of work is justified as people could always use the webhook-extension or their own implementation to integrate hocuspocus into their existing applications.
from hocuspocus.
You can always use difference endpoint for socket.io and plain websocket to make them work together.
from hocuspocus.
There is already a lot of documentation. Let us know if you miss anything:
- https://www.hocuspocus.dev/extensions/webhook
- https://www.hocuspocus.dev/guide/framework-integration
from hocuspocus.
The y-websocket client used to have support for Socket.io:
https://gist.github.com/dmonad/acd89745de1115cf712b35dcacd15cda
I’ll need to find out why it’s not in the client anymore. But from everything I know, I have to agree with @kriskbx: I don’t think it makes sense to build out Socket.io support (extending the server AND creating a new client) in the current stage.
from hocuspocus.
The reason why I switched from socket.io to pure Websockets is that the dependency load of socket.io is immense. It incurs extra overhead in every step without adding anything relevant to realtime applications. Any of the fallback solutions (HTTP long pulling, flash sockets (Adobe Flash), server sent events, ..) are not suitable for modern shared editing applications. We can do much better with pure Websockets which are supported in every browser since 2012. As @kriskbx mentioned, it should be possible to implement y-websocket backends in different programming languages. The socket.io protocol is pretty complex and it will take extra effort to port that to another language.
from hocuspocus.
Instead of building anything, just providing documentation for how to use express / socketio / and the webhook-extension might be helpful. I'll try to get an example together and share it here when I have something working.
from hocuspocus.
Hi guys!
I'm using socket.io in my project for chat and want to use hocuspocus for collaboration.
Is there a way to combine this?
from hocuspocus.
Unfortunately not!
from hocuspocus.
Oh, maybe you know of an alternative library instead of socket.io that I can use for chat and that will work with hocuspocus?
from hocuspocus.
Related Issues (20)
- Converting an initial html content to ydoc with a NodeJS server and saving it in database does not work. HOT 5
- Document is always empty HOT 3
- broadcastStateless extend exclude Connection param HOT 1
- CLI fails to run server, error: The option `alias` has been renamed to `shortFlag`. The following flags need to be updated: `--port`, `--webhook`, `--sqlite` HOT 3
- Running playground locally depends on 192.168.0.7? HOT 1
- Request: throttle updates sent from the client
- Failed to resolve entry for package "@hocuspocus/provider". HOT 2
- Server doesn't export DirectConnection HOT 2
- What's the best way to edit the document server-side? HOT 3
- WebsocketProvider not destroyed HOT 5
- Monitor info.configuration is undefined HOT 2
- Nextjs - Firefox can’t establish a connection to the server at ws://127.0.0.1:1234/ HOT 3
- Many operations to disconnect/destroy HOT 2
- Release to fix bugs introduced since 2.0.4/2.0.5 HOT 5
- onStoreDocument only store the combined updates HOT 2
- Expose Message type in `beforeHandleMessage` HOT 2
- Replace unload with visibility API HOT 2
- HocuspocusProvider parameters are ignored when websocketProvider is set HOT 4
- Does not load data on initial page load in Nextjs HOT 1
- Provider stops syncing after iOS wakes HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hocuspocus.