Skip to main content
gamedev.net
🔒 Locked

[Help]Psql Proxy

Started by psql May 15, 2008 at 10:45 PM 1 replies 700+ views
Original Post
psql
psql
I want build a psql proxy which could deal with the connection request from localhost to psql server which on other machine by type in psql -h localhost -U bob network. what function should I use to capture these information in my proxy code. I try to print the buf but there is nothing there after the read function. Cheers!
Anonymous P
Anonymous P
Quote:
I want build a psql proxy which could deal with the connection request from localhost to psql server which on other machine by type in psql -h localhost -U bob network.
Why would you do that?

Why not use psql on localhost to deal with the connection request from localhost to the postgresql server on the other machine, like so:

psql -U bob -h remote.mynetwork.com -d mydbname

hplus0603
hplus0603
Or you can set up a permanent SSH tunnel between your local host and the remote postgres server. Seems a lot easier than writing a tunneling server yourself.

In general, though, the tunnel is easy: accept a TCP connection on one end; establish the connection to your peer on the other end, and make that connection on the other end. The source/destination IP and port need to already be established; there's no way to connect to an arbitrary remote port/IP using simply tunneling. If that's what you want to do, you want a SOCKS 5 proxy or something similar.
enum Bool { True, False, FileNotFound };

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.