tags:

views:

99

answers:

1

Hi,

For the past fifteen day I'm breaking my head to solve this issue. I have a PHP application which connects to a remote mysql server, but the application can't directly access the remote mysql server, it has to connect through a socks proxy. Please could anyone help me to solve this issue.

Thanks in advance.

A: 

I think you'll need to set up port forwarding through your SOCKS proxy. With this you open a local port (e.g. on 3306) which forwards connections to a remote host and port (databasehost:3306) through a SOCKS proxy. You run this in the background and make PHP connect to localhost:3306 (which will then be forwarded/tunneled to databasehost:3306)

schuilr
How to do this? please could you help me?
Kaartz
It would be a lot easier (and more secure) if you can set up a SSH connection to that machine and let SSH forward the port. Is that an option for you?
schuilr
I have access to the mysql server, but I can't ssh into that server.
Kaartz
Well I'm not really familiar with other tools than just plain old SSH to create (secure) tunnels but I guess you could try what is described here: http://blog.kagesenshi.org/2006/02/portforwarding-again-but-this-time.htmlI'm not sure who owns this proxy and over what kind of network you're doing this but be aware that your connection is not secure. Therefore it may be possible to intercept data including your mysql login credentials.
schuilr