How to create a proxy gateway?

I have a great IM, I need a proxy of type (SOCKS4, SOCKS4A, SOCKS5) to work. However, my company uses the Http Proxy.

I would like to create my own proxy server that will simply transfer data to my proxy server (I need to enter a username and password to connect to this proxy server). How to do it?

+4
source share
5 answers

If you need proxy software, why reinvent the wheel? Just use what is already written (i.e. jsocks ). It should be possible to add authentication if you need it.

If your company's proxy server is only HTTP, I doubt that simple forwarding will work only for SOCKS software.

+3
source

If the company is so restrictive regarding Internet access, the proxy server is most likely configured only as HTTP gateways, there will be no port commands available, so direct Internet traffic goes out of range without a special window from the network.

The user box can be your home Internet router with DD-WRT or OpenWRT installed. The only thing you need to do is configure the ssh console on port 443 (HTTPS) - all with a nice web admin panel (DD-WRT has the advantage of ease of use). An alternative is to use a separate linux box, a dedicated server or a cheap virtual server, since you only need the functionality - it is to run an ssh server on port 443.

If you have a linux box with ssh on port 22 or another, not the default, just add the following lines to /etc/init.d/local (or / etc / conf.d / local.start):

iptables -A PREROUTING -t nat -p tcp --dport 443 -j REDIRECT --to-port 22 iptables -I INPUT -j ACCEPT -p tcp --dport 443 iptables -I INPUT -j ACCEPT -p tcp --dport 22 

Now you need to connect to your box from work, you can use the Swiss army knife putty. Here is a good article on proxy bypass, and here is an article on how to configure a local SOCKS proxy server on a machine running a spatula client. Combine both articles to get the expected result - setting up the SOCKS proxy server when connecting due to the HTTP proxy server.

Good luck, freedom will win.

+3
source

Is an HTTP proxy configured in Windows Internet settings? If so, you can tell Java to use the system proxy, for example:

 System.setProperty("java.net.useSystemProxies", "true");
System.setProperty("java.net.useSystemProxies", "true"); 
0
source

My question does not arise, I think?

Do you want to write a java component that has the SOCKS API on one end and HTTP on the other? What protocol does your instant messenger application use? As "mindas" tips, you may need much more than just forwarding.

If you're just looking for java sofwtware that handles HTTP mechanisms, including proxy authentication, go for Apache httpcomponents http://hc.apache.org/

0
source

You will need two proxies, one opposite the HTTP proxy and one behind it. It’s easier to just install one new SOCKS proxy.

 Instant Messenger --> IM Proxy 1 --> HTTP Proxy --> IM Proxy 2 --> Internets IM HTTP HTTP IM protocol protocol 

vs.

 Instance Messenger --> SOCKS Proxy --> Internets SOCKS IM protocol protocol 
0
source

Source: https://habr.com/ru/post/1333454/


All Articles