tldr/pages/common/socat.md

17 lines
454 B
Markdown
Raw Normal View History

2016-01-19 08:55:37 +00:00
# socat
2016-01-19 10:53:40 +00:00
> Multipurpose relay (SOcket CAT).
> More information: <http://www.dest-unreach.org/socat/>.
2016-01-19 08:55:37 +00:00
2016-01-20 01:22:04 +00:00
- Listen to a port, wait for an incoming connection and transfer data to STDIO:
2016-01-19 08:55:37 +00:00
`socat - TCP-LISTEN:8080,fork`
2016-01-19 10:53:40 +00:00
- Create a connection to a host and port, transfer data in STDIO to connected host:
2016-01-19 08:55:37 +00:00
`socat - TCP4:www.example.com:80`
2016-01-19 08:55:37 +00:00
2016-01-20 01:22:04 +00:00
- Forward incoming data of a local port to another host and port:
2016-01-19 08:55:37 +00:00
`socat TCP-LISTEN:80,fork TCP4:www.example.com:80`