titanium-web-proxy icon indicating copy to clipboard operation
titanium-web-proxy copied to clipboard

Unable to proxy Socks5 in beta

Open bbhxwl opened this issue 5 years ago • 28 comments

I ran titanium.web.proxy.examples.basic, released the comments of the following code, tested the native 127.0.0.1 and port 1080, unable to run normally?

var socksEndPoint = new SocksProxyEndPoint(IPAddress.Any, 1080, true) { // Generic Certificate hostname to use // When SNI is disabled by client GenericCertificateName = "google.com" };

       proxyServer.AddEndPoint(socksEndPoint);

bbhxwl avatar Dec 27 '19 05:12 bbhxwl

What is the problem?

honfika avatar Dec 27 '19 07:12 honfika

What is the problem?

Is this the key code of Socks5? Did I test or couldn't support Socks5?

bbhxwl avatar Dec 27 '19 10:12 bbhxwl

Yes, that is the code.

honfika avatar Dec 27 '19 11:12 honfika

After I enable it, I can't connect to Socks5 properly. Is there a bug?

bbhxwl avatar Dec 27 '19 11:12 bbhxwl

There is a problem. UDP function cannot be proxy

bbhxwl avatar Dec 27 '19 11:12 bbhxwl

QQ图片20191227193120

bbhxwl avatar Dec 27 '19 11:12 bbhxwl

Yes, this is TCP only

honfika avatar Dec 27 '19 11:12 honfika

Will UDP compatible forwarding be considered in the future?

bbhxwl avatar Dec 27 '19 11:12 bbhxwl

Could you please translate your screnshot? I can't speak chinese, and can1t copy the characters from an image:)

honfika avatar Dec 27 '19 11:12 honfika

How do you use UDP Socks from a browser? Or what is the source of your HTTP requests?

honfika avatar Dec 27 '19 11:12 honfika

The text of the picture is probably that the test TCP passed and UDP failed. If you want to be a proxy server, you can not only speed up HTTP and UDP, but also speed up the game. If it is compatible, it will be a more powerful project.

bbhxwl avatar Dec 27 '19 11:12 bbhxwl

But TWP is a HTTP proxy... it accepts only HTTP requests in SOCKS protocol.... there are many simple socks proxy on the internet.

honfika avatar Dec 27 '19 11:12 honfika

Well, I want to integrate.

bbhxwl avatar Dec 27 '19 12:12 bbhxwl

Can't you make something like a plug-in? Support for UDP will not affect the TCP function of Socks5.

bbhxwl avatar Dec 28 '19 07:12 bbhxwl

But TWP is a HTTP proxy... it accepts only HTTP requests in SOCKS protocol.... there are many simple socks proxy on the internet.

Does the official version support Socks5 authentication? Hope to consider adding a UDP forwarding.

bbhxwl avatar Jan 03 '20 08:01 bbhxwl

Yes, it supports authentication, you have to set the ProxyBasicAuthenticateFunc property to authorize the connection.

honfika avatar Jan 03 '20 09:01 honfika

However i did not found any browser which supprots SOCKS5 authentication. It is possible only with a Firefox addon, FoxyProxy. I tried that, and it was working with TWP.

honfika avatar Jan 03 '20 09:01 honfika

I want to know HTTP authentication and sock5 authentication. In addition to limiting the account and password, I can get the IP of the client. I want to do the IP restriction

bbhxwl avatar Jan 03 '20 10:01 bbhxwl

If I don't want to intercept HTTPS and forward data directly, can I not write the onbeforetunnelconnectrequest event? Is the default e.decryptssl = false?

bbhxwl avatar Jan 03 '20 10:01 bbhxwl

The default is "true".

If you don't want to decrypt any traffic, i suggest you to disable decryption globally in the endpoint constructor.

Currently the client infomration is not available for SOCKS authentication (the SessionEventArgsBase parameter is null)

honfika avatar Jan 03 '20 10:01 honfika

explicitEndPoint.DecryptSsl is read-only If I don't want to intercept any data and just want to be an HTTP proxy, I can add no events, right? Just add an explicitproxyendpoint.

bbhxwl avatar Jan 03 '20 10:01 bbhxwl

Set the constructor parameter of the endpoint object.

honfika avatar Jan 03 '20 10:01 honfika

Sock5 authentication cannot be restricted in proxybasicauthenticatefunc, right?

proxyServer.ProxyBasicAuthenticateFunc = async (args, userName, password) => {

            return true;
        };

var socksEndPoint = new SocksProxyEndPoint(IPAddress.Any, 1080,false) { // Generic Certificate hostname to use // When SNI is disabled by client GenericCertificateName = "google.com" };

        proxyServer.AddEndPoint(socksEndPoint);

bbhxwl avatar Jan 03 '20 10:01 bbhxwl

It can be restricted as you wrote.

honfika avatar Jan 03 '20 10:01 honfika

So you can limit sock5? Recommend the author's S5 client program sstap and C ා open source program netch. Is the author not going to support UDP forwarding?

bbhxwl avatar Jan 03 '20 11:01 bbhxwl

Is there a way that the user can not enter the password? I will judge the authorization according to the IP. If the user enters the account and password, I will judge with the account and password. It seems that after writing proxybasicauthenticatefunc, you must enter the account and password, right?

bbhxwl avatar Jan 04 '20 06:01 bbhxwl

Yes, if you set the proxybasicauthenticatefunc the user must enter the username and password.

honfika avatar Jan 04 '20 07:01 honfika

I have written these codes that can be used normally. There are some parameters that I don't understand.

For example, I don't know proxyserver.enablewinauth

What is the function of this parameter? Is args.clientremoteendpoint.address.maptoipv4() in proxyserver.proxybasicauthenticatefunc the IP address of the connector? Is proxyendpoint the IP address of the connected (server)? Should clientlocalendpoint be the server's native IP?

Is proxyserver.forwardtoupstreamgateway important? What will happen if I cancel? Does enabling http2 have any effect on the load?

proxyServer = new ProxyServer(); proxyServer.EnableHttp2 = true; proxyServer.ExceptionFunc = exception => {

            };
            proxyServer.ForwardToUpstreamGateway = true;

proxyServer.BeforeRequest += onRequest; proxyServer.BeforeResponse += onResponse; proxyServer.EnableWinAuth = true; proxyServer.ProxyBasicAuthenticateFunc = async (args, userName, password) => { return true; }; explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Any, TcpPort, false); proxyServer.AddEndPoint(explicitEndPoint); proxyServer.Start();

bbhxwl avatar Jan 05 '20 09:01 bbhxwl