Skip to content
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

Multiple websocket connections #82

Open
sudozid opened this issue Jul 5, 2023 · 3 comments
Open

Multiple websocket connections #82

sudozid opened this issue Jul 5, 2023 · 3 comments

Comments

@sudozid
Copy link

sudozid commented Jul 5, 2023

Hi

Im wondering if it would be possible for multiple websocket connections to be implemented for better performance. This would make a big difference if ISPs throttle connections or if distance between client and the server is high

Thanks

@MarcelCoding
Copy link
Owner

MarcelCoding commented Jul 5, 2023

Definitely an interesting topic also for the only TCP version. This would also probably make use of multiple CPU cores. Currently, on thread (tokio task) is dedicated to TX and one to RX. With multiple connections, this could probably implement multithreaded. I'll look into it, but I can't specify any time span for results.

@MarcelCoding
Copy link
Owner

MarcelCoding commented Oct 2, 2023

@sudozid I've played a bit around and did a rewrite. Now, multiple websocket connections should be possible. #105

Till now I've only deployed the server and client on my laptop and for some reason could not reach some websites. If I use the new client on my laptop but the old (master branch) zia deployed on my server, it works fine. So if it isn't a problem with the server and client on the same machine it is a problem on the server side.

The client has a new option -c so specify the amount of connections that should be used. Also, the Pull Request currently only supports websocket and no tcp. Additionally, I've disabled websocket masking for frames send from the client (a thing the spec enforces). Because the old server is spec complaint, it requires masking of frames send from the client. You can tell the client to force masking using -m. The new server accepts masked and non-masked frames without any configuration. This also could be useful if some kind of http proxy rejects non-masked websocket frames send from the client. (idk why this should be done)

I hope you are able to use the new version without any documentation and just using --help. The binaries are available as artifacts of the actions of the latest commit in the pull request. (you need to be logged in in order to download them)

@MarcelCoding
Copy link
Owner

I've merged it into master, show builds are now available through actions. I've seen a massive improvement: (my school)

  • one proxy connection (20-35 Mbit)
  • 8 connections (200 Mbit)

Feel free to provide feedback.

Also, it should now be may more stable. But if one connection dies, the client currently not tries to open new ones.

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