#583164 socat: *-listen options middle ip/hostname param to restrict to one address

Package:
socat
Source:
socat
Description:
multipurpose relay for bidirectional data transfer
Submitter:
Mark Hedges
Date:
2011-07-07 13:06:08 UTC
Severity:
wishlist
#583164#5
Date:
2010-05-25 21:16:15 UTC
From:
To:
In this scenario, the client does:

 ssh -X -f -L 3333:localhost:3333 user@server gnome-terminal
 socat -v -d -d udp4-listen:53,reuseaddr,fork tcp:localhost:3333

Server runs DNS on 127.0.0.3 and does:

 socat tcp4-listen:3333,reuseaddr,fork UDP:127.0.0.3:53

Tiger complains that the listeners listen on every interface.

I would be cool to be able to do:

 client:  socat -v -d -d udp4-listen:localhost:53,reuseaddr,fork tcp:localhost:3333
 server:  socat tcp4-listen:localhost:3333,reuseaddr,fork UDP:127.0.0.3:53

HTH.  --m--

#583164#10
Date:
2011-07-07 13:03:24 UTC
From:
To:
For this purpose you have "bind" option.
       bind=<sockname>
              Binds  the  socket  to the given socket address using the bind()
              system call. The form of <sockname> is socket domain  dependent:
              IP4   and   IP6  allow  the  form  [hostname|hostaddress][:(ser‐
              vice|port)] (example), UNIX domain sockets require <filename>.

I've tested for TCP4 sockets, but theoretically it works for all
sockets. Isn't this enough?

Cheers