Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

OS is Windows (any flavor, I can adapt). I'm having an issue where I need to connect to imap.google.com (and other services) and it only accepts port 995.

If I try to connect normally, it timeouts. If I manually connect through putty issuing CONNECT plus proxy credentials (username & password) the remote host disconnects me (which I think is a good thing, since I'm doing a simple HTTP/1.1 request).

Now, I need to know what kind of software I can use to create a -local- proxy, either using a specific software or SSH tunneling stuff, so my connections to localhost:600, for example, get redirected to imap.google.com:995 BUT authenticating against the proxy I'm behind.

Any ideas?

share|improve this question
up vote 0 down vote accepted

Socat can probably do this. Binaries for windows are available here.

You can then use socat TCP-L:600,reuseaddr,fork,PROXY:yourproxyaddress.example:imap.google.com:995,proxyauth=user:pass,proxyport=8080.

share|improve this answer
    
Awesome! your socat suggestion helped! the command however is a bit wrong, as it makes socat throw an error about requiring two addresses. A quick google search and experimentation allowed me to generate the correct command: socat TCP-L:600,reuseaddr,fork PROXY:proxy:imap.gmail.com:993,proxyport=8080,proxyauth=usr:pwd thanks! :D - Also, how can I run multiple socats (I need 2, one for IMAP and another one for SMTP) without having those command windows opened? And is there a way to make it go through a local SSH server first (for security and encryption)? or should I make a separate question? – DARKGuy Mar 31 '14 at 16:43
    
@DARKGuy I updated my answer to correct the command. You can write the commands in a batch file and use something like bat to exe converter to create exe that doesn't open the command line window. I don't know how to add ssh in there, though if I'm not mistaken port 993 already has ssl encryption. – user2313067 Mar 31 '14 at 17:17
    
Alright. Don't worry, I managed to make a simple batch script to do so. Thanks a lot! :D – DARKGuy Apr 7 '14 at 12:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .