Discussion:
psql proxy
Linsong GUO
2008-05-16 03:53:30 UTC
Permalink
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!
Martijn van Oosterhout
2008-05-16 08:23:18 UTC
Permalink
Post by Linsong GUO
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.
Simple solution: use ssh tunneling

Without any security: use netcat
Post by Linsong GUO
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.
There's nothing special needed for psql, just using a standard network
proxy will be fine.

Have a nice day,
--
Post by Linsong GUO
Please line up in a tree and maintain the heap invariant while
boarding. Thank you for flying nlogn airlines.
Linsong GUO
2008-05-16 11:34:56 UTC
Permalink
in the terminal I input psql -h localhost -U bob network

the problem is I do not know how to capture the user name and password
information in my proxy code.

after read function it is seems nothing in the buf

could you suggest some stand proxy example for me

thanks for your help
Post by Linsong GUO
Post by Linsong GUO
I want build a psql proxy which could deal with the connection request
from
Post by Linsong GUO
localhost to psql server which on other machine by type in psql -h
localhost
Post by Linsong GUO
-U bob network.
Simple solution: use ssh tunneling
Without any security: use netcat
Post by Linsong GUO
what function should I use to capture these information in my proxy code.
I
Post by Linsong GUO
try to print the buf but there is nothing there after the read function.
There's nothing special needed for psql, just using a standard network
proxy will be fine.
Have a nice day,
--
Post by Linsong GUO
Please line up in a tree and maintain the heap invariant while
boarding. Thank you for flying nlogn airlines.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFILUR2IB7bNG8LQkwRAsd7AJ9tZxwvb5ZYYQIj0uLUj7Bo1B2IiwCfdF/B
KBXplgDjJXOCgw6lqJvZ2VI=
=Zbvh
-----END PGP SIGNATURE-----
Gerald Quimpo
2008-05-16 22:39:20 UTC
Permalink
Post by Linsong GUO
in the terminal I input psql -h localhost -U bob network
the problem is I do not know how to capture the user name and password
information in my proxy code.
after read function it is seems nothing in the buf
could you suggest some stand proxy example for me
Martijn pointed you at ssh tunnelling and netcat. You either need
something that ssh tunnelling/netcat CANNOT do for you, or you
don't understand that ssh tunnelling/netcat are sufficient for what
you need to do. It's not clear which of those it is.

Why don't you describe the requirement at a lower level (e.g.,
what are the two computers you've got, what is between the
two computers [is there a firewall, is the other computer on
the other side of the world from you], etc). As it is, your
problem statement is too high level. You're assuming that you
need to write your own proxy. Consider lower level solutions.
Or are you writing a proxy for fun? If so, how is the proxy
supposed to work? you run psql at the local box, it connects
to the proxy, and the proxy passes everything over to the
remote box? ssh/netcat will do that for you. What other
reasons do you have for writing your own proxy? The only
thing I can think of is sniffing the passwords of other users,
but I'm sure there are other interesting things you might be
trying to do.

Gerald
--
Gerald Timothy Quimpo ***@gmail.com
I'm so miserable without you, it's almost like you're here.
--
Sent via pgsql-general mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Loading...