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 config for http obfs request method. #208

Merged
merged 3 commits into from Jul 3, 2018
Merged

Add config for http obfs request method. #208

merged 3 commits into from Jul 3, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jul 2, 2018

The http request method can be specified using --http-method, this parameter must be the same on both client and server side.
for example:

obfs-server -s 127.0.0.1 -p 80 -r 127.0.0.1:8388 --obfs http --http-method POST
obfs-local -s 1.2.3.4 -p 80 -l 8388 --obfs http --http-method POST

The original request is GET, but it has a Content-Length header which is strange. POST or PUT may be better.

@madeye madeye merged commit 26bc54b into shadowsocks:master Jul 3, 2018
@love4taylor
Copy link

服务端做不到自适应么, 一些平台的客户端并不一定会更新支持.

@ghost
Copy link
Author

ghost commented Jul 4, 2018

The server check the request method on L201@obfs_http.c. Delete this and the next line then the server will accept the connection regardless of the HTTP request method.

Before this commit obfs-server also checks the HTTP method and ensure the method is GET, and I just kept this feature.

@ghost ghost mentioned this pull request Jul 4, 2018
@Windendless
Copy link

rfc6455:The WebSocket Protocol says:

The method of the request MUST be GET, and the HTTP version MUST
be at least 1.1.

@ghost
Copy link
Author

ghost commented Jul 11, 2018

In my opinion
HTTP obfs is NOT a websocket connection. What does this plugin do is just obfusacting, not implementing the protocol.
It do not calculate the websocket-key, just using random bytes and, do not have header Sec-WebSocket-Version
client write extra data after request, real web browser will never do that.

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.

3 participants