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

Add TCP Fast Open support #1328

Closed
wants to merge 1 commit into from
Closed

Add TCP Fast Open support #1328

wants to merge 1 commit into from

Conversation

wongsyrone
Copy link
Contributor

Forward proxy has been removed since we cannot control
its socket options.

Signed-off-by: Syrone Wong [email protected]

Forward proxy has been removed since we cannot control
its socket options.

Signed-off-by: Syrone Wong <[email protected]>
@wongsyrone
Copy link
Contributor Author

It hasn't been tested on Windows 7; I don't have such devices.

@chenshaoju
Copy link
Collaborator

The Appveyor url in readme.md is broken ( https://ci.appveyor.com/project/wongsyrone/shadowsocks-windows-yqdou ) Unable test.

(Too lazy for compile 😅 )

@wongsyrone
Copy link
Contributor Author

@chenshaoju
Copy link
Collaborator

On Windows 7,Log print:

[2017-08-19 17:08:48] TFO: False

@wongsyrone
Copy link
Contributor Author

It's expected. #1045

@celeron533
Copy link
Contributor

celeron533 commented Aug 21, 2017

The requirement is conflict with pull request #1214 (Forward http proxy with Auth) 😟
Also may have impact with #1298 (SIP002, SIP003)

@wongsyrone
Copy link
Contributor Author

wongsyrone commented Aug 21, 2017

I talked with @madeye before, he agreed to remove Forward proxy.

@madeye
Copy link
Contributor

madeye commented Aug 21, 2017

Is it possible to implement forward proxy as a SIP003 plugin instead? If so, we can keep our core code base as clean as possible.

@madeye
Copy link
Contributor

madeye commented Aug 21, 2017

IMO, the priority list of pull requests is SIP003 > TFO > Forward proxy.

@wongsyrone
Copy link
Contributor Author

wongsyrone commented Aug 21, 2017

I choose not to modify my PR.

@wongsyrone wongsyrone closed this Aug 21, 2017
@rwasef1830
Copy link
Contributor

rwasef1830 commented Aug 21, 2017

@madeye @wongsyrone Why is this in conflict with my pull request ? I don't touch any of the core tcp / udp relay code (I implemented it in a far simpler way from a higher level).

I see no reason why we can't have tcp fast open at least for the supported cases (no forward proxy, no sip003 plugin, supported OS).

In case of forward proxy or sip003, it is the responsibility of the proxy or plugin to also implement tcp fast open but no reason why we can't have it too...

@madeye
Copy link
Contributor

madeye commented Aug 22, 2017

Yes, if there is no conflict, I think we can try to merge this PR next.

@rwasef1830 Any interest to help merge this one?

@rwasef1830
Copy link
Contributor

Yes, should I open a new pull request and cherry pick the commit to my fork ? I want to maintain credits to @wongsyrone

@madeye
Copy link
Contributor

madeye commented Aug 22, 2017

I think we'd better open a new pull request and rebase the latest changes then.

@wongsyrone What do you think?

@wongsyrone
Copy link
Contributor Author

There are two must-have for TFO.

  1. be able to control remote socket option
  2. be able to receive handshaking from client thus we have data to send when connecting

Under forward proxy, I have no idea on fulfilling these two requirements.

Currently, I'm investigating c-ares, cannot find much time to rebase. If someone has interest, he can mention my ID in the commit message. As I said before, it serves as a reference implementation, everyone can use without notice.

@rwasef1830
Copy link
Contributor

rwasef1830 commented Aug 22, 2017

@wongsyrone ok, thanks. I will cherry pick and open a new pull request. I will mention you in the commit message. I will leave forward proxy option, just that when it is used, fast open will be disabled.

@celeron533
Copy link
Contributor

Sorry I have not get sufficient time to review all the code of this pull request and do a full assessment of code impacts.

@wongsyrone
Copy link
Contributor Author

Forgot to mention, the two must-have above is specific to the Socket.ConnectAsync() way. If you want to pass parameters to the plugin like: "param=tcp-fast-open;blah-blah" to notify other layers to enable TFO. That layer should use ConnectEx on Windows, otherwise, it won't work.

@rwasef1830
Copy link
Contributor

rwasef1830 commented Aug 25, 2017

@wongsyrone Yeah I noticed this. Currently, I am trying to make the changes as small as possible to implement this, but I really have the urge of rewriting that layer.. The ancient BeginXXX EndXXX style code is very scattered and hard to follow.

@wongsyrone
Copy link
Contributor Author

Do you want to use TAP? I already implemented it with SAEA for the whole networking layer.

@rwasef1830
Copy link
Contributor

rwasef1830 commented Aug 25, 2017

I want to change IProxy interface to expose TAP and wrap SAEA into TAP interface, it is much cleaner. Even better if I can make it expose Stream interface, so unit testing becomes possible.

Then I want to have all code using TAP async/await. It will make the flow much cleaner.
All the manual Timer objects can be replaced with CancellationToken.

Anyway, I am working on this.

@wongsyrone
Copy link
Contributor Author

In fact, there is no need to convert all code into TAP. If you use SAEA, there is no need to keep connect timer, just let the socket layer handle it.

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

Successfully merging this pull request may close these issues.

5 participants