Kqzz / MCsniperGO

MCsniperGO, a fast, efficient, and feature-packed minecraft name sniper.
https://mcsniperpy.com
187 stars 37 forks source link

socks proxy authentication not working #89

Closed bennyd87708 closed 12 months ago

bennyd87708 commented 1 year ago

Trying to use a socks5 proxy that requires auth, but it seems to fail with error: [*] the server closed connection before returning the first response byte. Make sure the server returns 'Connection: close' response header before closing the connection #1 My proxies are in the list in the format: user:pass@address:port as suggested by the readme. I made an attempt to play around with the code a little bit and noticed a function SetProxy in http.go that seems to check if it is a socks proxy and work differently, but it doesn't seem as though this function is ever called. I tried to make it work anyways by formatting my proxies as user:pass@socks5://ip:port but I think my attempts are in vain. Appreciate any help <3

Kqzz commented 12 months ago

There isn’t currently support for socks5 proxies, since I haven’t run into anyone trying to use them in the past. I’ll add it by the end of the day today, however in the mean time you could just claim without proxies.

Kqzz commented 12 months ago

If you want to mess around yourself, this line of code is what affects the proxy for each individual request. Fasthttproxy has a socks dialier that you can call instead of the current http one.

https://github.com/Kqzz/MCsniperGO/blob/53648b64fd49ff17074caf34c058b38d95527a9b/claimer/claimer.go#L103C2-L103C2

bennyd87708 commented 12 months ago

Changing this line to client.Dial = fasthttpproxy.FasthttpSocksDialer(claim.Proxy) does allow it to use a socks proxy instead of http, but it seems as though this function simply doesn't support authentication for some reason. If you use the same format as with http, it responds with proxy: unknown scheme: ... and none of the fairly minimal documentation on fasthttp seems to address this, as all of their examples are auth-less. I might try to go bark up their tree for any info, but don't worry too much about it, definitely not the end of the world. Thanks for the help regardless