Skip to content

[Extension idea] WebSocket extension improvements #2037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Xeltalliv opened this issue Mar 16, 2025 · 3 comments
Open

[Extension idea] WebSocket extension improvements #2037

Xeltalliv opened this issue Mar 16, 2025 · 3 comments

Comments

@Xeltalliv
Copy link
Contributor

Xeltalliv commented Mar 16, 2025

The current WebSocket extension isn't very good in terms of functionality, and while currently there is a PR for another better extension, it still doesn't resolve all of the issues. I think the hypothetical complete WebSocket extension could be a lot better.

In my opinion, if the complete extension existed, it should have those features:

  1. Have a system for working with multiple connections at once.
  2. Have a way to listen on ports and act as a server (would only work in TW Desktop/packaged for obvious reasons). Just like multiple connections, this should support multiple listeners at once. Once connection establishes, both the client and the server should be able to treat the connection in the same way and use the same blocks to interact with it.
  3. Have a way to create, send, receive and parse binary messages. I think for constructing binary messages, the easiest solution to work with would be to sequentially concatenate values of specified types. And reading should be done similarly, where user specifies which type to read, it reads the correct amount of bytes, and steps forward by that amount of bytes, ready for the next read. Also there could be a way to "seek" to some specified offset. And for including text in binary messages, there should also be some way to use javascript's TextEncoder and TextDecoder.

Giving the ideas, because probably no-one other the GarboMuffin can do the electron<->nodejs communication part in a proper way.

@GarboMuffin
Copy link
Member

The idea of having our own reverse proxy so that people can run servers from a browser has discussed before in one of the webhook pull requests

@Xeltalliv
Copy link
Contributor Author

Xeltalliv commented Mar 17, 2025

But I still think the one without reverse proxy could be better because of reduced latency and the general ability to handle more concurrent connections.

@GarboMuffin
Copy link
Member

yes it would be better when it's available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants