GithubHelp home page GithubHelp logo

Comments (5)

thealmarques avatar thealmarques commented on May 26, 2024

Hey! There is no polling! If you look carefully you can find the module that also uses websockets: collaborative.ts

from tinymce-collaborative-editing-plugin.

mikkorantalainen avatar mikkorantalainen commented on May 26, 2024

It seems that if socketUrl starts with letters https://(by mistake) the code will automatically switch to polling but it will try websocket connection if socketUrl starts with wss://. It also seems that any path in socketUrl is always ignored and replaced with hardcoded string /socket.io.

Also worth mentioning is that socket.io is not standard WebSocket connection but a custom protocol (https://socket.io/docs/v4/#what-socketio-is-not). I'm using HAProxy as reverse proxy (and TLS termination) and I can't get socket.io connections to go through the proxy even though native WebSocket in client + ws WebSocket Server work just fine. I'm still not sure if this is caused by something in socket.io or in HAProxy.

It might be that you can get non-polling behavior with direct port connection.

from tinymce-collaborative-editing-plugin.

mikkorantalainen avatar mikkorantalainen commented on May 26, 2024

The demo at https://codepen.io/thealmarques/pen/YzqOrWV seems to have socketUrl starting with https:// but the browser still connects with WebSocket connection. I still don't understand how it can work unless the code depends in some specific behavior of some non-updated dependency. I started with updating all dependencies after cloning the source.

from tinymce-collaborative-editing-plugin.

mikkorantalainen avatar mikkorantalainen commented on May 26, 2024

In addition, running the server code with ts-node ./src/server.ts seems to randomly crash with following error:

Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:111:27)
npm ERR! code ELIFECYCLE
npm ERR! errno 1

I think this is a bug in ts-node. I think it's related to nodejs/node#23169

This crash happens when I run the server behind HAProxy but it suggests that if the browser client TCP/IP traffic looks similar to HAProxy traffic in some situations, the server would also crash with direct client connection.

from tinymce-collaborative-editing-plugin.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.