Proxy [Http, Socks4, Socks5] in webbrowser [c#]

0 votes
asked Nov 25, 2014 by LakiLova (120 points)
edited Sep 14, 2015 by Tomas Knopp

Hi, Is it possible to run the proxy on this project using Rebex

http://image.noelshack.com/fichiers/2014/48/1416833908-ae.jpg

And that he was working I want code source

1 Answer

0 votes
answered Nov 25, 2014 by Lukas Pokorny (92,750 points)
edited Nov 25, 2014

Hello, Rebex components include a client-side HTTP, Socks4 and Socks5 proxy objects that are used by our FTP, SFTP, SSH, SMTP, IMAP and POP3 client objects. Those client-side proxy objects can be used stand-alone as well, and other protocols can be run over them. However, at the moment, I am unsure what purpose you would like to use them for.

For example, Rebex.Net.ProxySocket object from Rebex.Networking.dll assembly can be used to connect to an HTTP server through a proxy:

        // specify proxy info
        var proxy = new Proxy();
        proxy.ProxyType = ProxyType.Socks5;
        proxy.Host = "proxy.example.org";
        proxy.Port = 1080;
        proxy.UserName = "user01";
        proxy.Password = "password";

        // create an instance of Rebex.Net.Proxysocket
        var socket = new ProxySocket(proxy);

        // connect to a server through the proxy
        socket.Connect("server01", 80);

        // send a request
        byte[] request = Encoding.ASCII.GetString("GET / HTTP/1.1\r\nHost: server01\r\n\r\n");
        socket.Send(request);

        // receive response (needs to be actually implemented)
        byte[] response = new byte[4096];
        socket.Receive(response);
        ...

However, to actually make this usable, you would have to provide a HTTP client object that can use the ProxySocket object as its transport layer.

...