tldr/pages/common/socat.md

21 lines
611 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`
2023-09-19 04:49:30 +01:00
- Listen on a port using SSL and print to STDOUT:
`socat OPENSSL-LISTEN:4433,reuseaddr,cert=./cert.pem,cafile=./ca.cert.pem,key=./key.pem,verify=0 STDOUT`
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`