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

Padding is not working #78

Closed
emacsenli opened this issue May 31, 2020 · 6 comments
Closed

Padding is not working #78

emacsenli opened this issue May 31, 2020 · 6 comments

Comments

@emacsenli
Copy link

emacsenli commented May 31, 2020

I have setup 2 naive clients (both released binary not compiled myself) on my local machine. one is listening on port 1080 with padding on while the other is on port 8080 without padding

while on VPS ,if caddyfile just remove upstream section as README.md said , naive worked fine.

but if I try "padding" mode , command curl -x socks5://127.0.0.1:1080 https://www.google.com just returned error "SSL_ERROR_SYSCALL" . and tcpdump localmachine 1080 ,show that with a ClientHello then no ServerHello back from google, and tcpdump of local machine to VPS stage ,there is nothing wrong,https stream works fine. so the problem is from stage between VPS and google.
and tcpdump of this stage shows that after 3 handshakes there is not a ClientHello but an unkown record ,and google return a Fatal Alert and RST immediately .

compare both tcpdump of localhost 1080 and VPS to google ,localhost has a ClientHello of payload length 585 in socks protocol ,but VPS to google is of payload length 880.
so this is problem I think

@darhwa
Copy link

darhwa commented May 31, 2020

Have you enabled padding for both your naive client and the naive server behind caddy?

@emacsenli
Copy link
Author

emacsenli commented Jun 1, 2020

Have you enabled padding for both your naive client and the naive server behind caddy?

ok let me put configurations on :

local machine

config.json for naive

> {
>   "listen": "socks://127.0.0.1:1080",
>   "proxy": "https://user:passwd@myDomain",
>   //"log": ,
>   "padding":true
> }
> 

VPS

config.json for naive with padding on

>{
  **"listen": "socks://127.0.0.1:1080",**
  "padding":true,
  "log": "/var/log/naiveproxy.log"
}

and Caddy file with upstream to socks at port 1080

> myDomain {
>>root /var/www/html
>>tls myEmail@email.com
>>forwardproxy {
>>  basicauth user passwd
>>   hide_ip
>>   hide_via
>>   probe_resistance secret.localhost
>>   **upstream socks5://127.0.0.1:1080**
>>   }
> }

md5sum of latest released binary file is 55be754d56d7ec83e3edd2f7b53e49cd
but my own compilation is 06814cb70ebefbefd4a32df68cdc8fd0
does that matter?

@darhwa
Copy link

darhwa commented Jun 1, 2020

In the naive server, you have to config it to listen on http://*** instead of socks5://*** to make the padding work correctly.

I agree that this is error-prone for users.

@emacsenli
Copy link
Author

Yes correct...Finally Done ,thanks

@KevinZonda
Copy link

KevinZonda commented Jun 9, 2020

@klzgrad This issue can be closed.

@klzgrad
Copy link
Owner

klzgrad commented Jun 16, 2020

Padding support is now auto-configured.

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

No branches or pull requests

4 participants