UlricE / pen

Pen
Other
250 stars 41 forks source link

IPv6 to IPv4 - is it possible? #40

Open wioxjk opened 6 years ago

wioxjk commented 6 years ago

I have not found any documentation regarding this matter, so I need to open up a ticket here in order to get some lights on my question :)

My situation: A loadbalancing server with IPv4 and IPv6, that proxies to servers with only IPv4. Is it possible to let clients connect to pen over IPv6 and pen itself check the IPv4 servers in the backend?

UlricE commented 6 years ago

Certainly, you can even proxy Unix sockets. Convoluted example here:

http://morestuff.siag.nu/2014/04/14/using-pen-as-an-address-family-adapter/

Less convoluted example:

ulric@debtest:~/Git/pen$ ./pen -df ::1:2222 127.0.0.1:22 2017-08-18 22:51:59: read_cfg((null)) 2017-08-18 22:51:59: Before: conns = (nil), connections_max = 0, clients = (nil), clients_max = 0 2017-08-18 22:51:59: expand_conntable(500) 2017-08-18 22:51:59: After: conns = 0x1c24900, connections_max = 500, clients = 0x7f94a8592010, clients_max = 2048 2017-08-18 22:51:59: pen 0.34.1 starting 2017-08-18 22:51:59: servers: 2017-08-18 22:51:59: 0 127.0.0.1:22:0:0:0:0

And in another window:

ulric@debtest:~$ ssh -p 2222 ::1

The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. You have new mail. Last login: Fri Aug 18 22:50:57 2017 from localhost `