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

TCP nodelay #5

Open
dgllghr opened this issue May 2, 2019 · 2 comments
Open

TCP nodelay #5

dgllghr opened this issue May 2, 2019 · 2 comments

Comments

@dgllghr
Copy link

dgllghr commented May 2, 2019

I've noticed that using TCP nodelay allows SOCKS connections to be established more quickly because the SOCKS negotiation includes many small messages. I haven't tested using nodelay with this library in particular, but it would be nice to provide this configuration option so that the caller can determine whether they want to use nodelay.

In general, it might be easier to allow the library consumer to have more control over how the underlying TCP connection is configured. The easiest way to do this would probably be to support a variant of Socks5Stream::connect that takes an existing TCP stream so the caller can set up the stream however they want, but this could also be done with specific configuration options.

I can set up a PR for any of these options pretty quickly, but I wanted to discuss first.

@sticnarf
Copy link
Owner

sticnarf commented May 2, 2019

It's not worth enabling nodelay just for quicker SOCKS negotiation because the effect continues after the negotiation. But it'll be nice to have configurable TCP connections.
I prefer to take an existing TCP connection rather than add configs in this library. I don't want to repeat net2's work.

@sticnarf
Copy link
Owner

Thanks to #20, it's possible to configure the socket ahead of time.

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