Questions tagged [socat]
56 questions
54
votes
3 answers
What's the difference between socat and netcat?
I understand that socat is described as a "more advanced" version of netcat, but what is the actual difference?
Would it be correct to say that everything you can do in netcat you can also do in socat? What about the opposite (everything you can do…
![](../../users/profiles/37767.webp)
bantic
- 1,469
- 3
- 14
- 17
42
votes
7 answers
Forward local port or socket file to remote socket file
Quick question - I run two linux boxes, one my own desktop and the other my VPS. For security reasons on the VPS end I opted for socket connections to MySQL (/var/run/mysqld/mysql.sock). I know I can tunnel like this: ssh -L 3307:127.0.0.1:3306…
user32616
29
votes
6 answers
echo server with netcat or socat
I want a UDP echo server to get packets, and reply exactly what it has received. How can I simply do this using netcat or socat? It should stay alive forever and handle packets coming from several hosts.
![](../../users/profiles/90670.webp)
Mohammad Hedayati
- 629
- 1
- 6
- 12
11
votes
2 answers
How to set up a persistent TCP gender-changer proxy?
I have a provider (A) that wants to send us data through an incoming TCP connection. Unfortunately the consuming service (B) cannot receive inbound TCP connections. Also it does not have a static IP, another requirement.
One way to solve this would…
![](../../users/profiles/73108.webp)
dtech
- 621
- 2
- 9
- 26
8
votes
2 answers
Access D-Bus remotely using socat
Description:
I'd like to access a D-Bus system service from another machine, knowing only machine's IP address and the service to connect to.
What I have recently found is Gabriel (D-Bus over SSH). I have compiled its GIT version (hosted on…
![](../../users/profiles/130988.webp)
schedar
- 161
- 1
- 7
8
votes
1 answer
socat: Show incoming connections
I am slightly going mad. Even if I call socat like this:
socat -vvvv tcp4-listen:9000 tcp4-listen:9001
it works perfectly, but doesn't inform me about incoming TCP connections! Is there an additional verbosity option that makes socat show this…
![](../../users/profiles/93418.webp)
Niklas B.
- 194
- 1
- 1
- 8
7
votes
1 answer
Always keep socat alive
I have a socat running nicely, executing my command when a connection comes in with the arguments provided. However, the issue I am having is that the socket is at EOF and the next time a connection comes in, the process takes 3 seconds to spin back…
![](../../users/profiles/25165.webp)
Robbie Trencheny
- 193
- 1
- 6
7
votes
1 answer
How do i use socat as a proxy server?
I'd like my .NET app to use a proxy which I know how to do except .net doesn't support sock4a/sock5. I know how to setup my app but, how do I setup socat to listen at as a TCP proxy on port 1234 and use the socks5 server at 127.0.0.1:5678?
It must…
user274
7
votes
2 answers
Forwarding serial port over network and back to serial char device on remote host (socat?)
I'm working with a linux application which needs to talk with a remotely-located serial (rs-232) device. I've worked out how to use socat on the remote end to send the device's serial data over an IP connection, but how do I then convert that IP…
![](../../users/profiles/119379.webp)
Alex G
- 376
- 1
- 4
- 13
7
votes
1 answer
Forwarding linux terminal from serial port to TCP with socat
I'm working on embedded ARM platform, Slackware. I'm using G24 Java modem which is configured to forward data between ports /dev/ttyS1 and /dev/ttyACM0, so anything that goes onto any of these ports is then visible on the other. I want to set…
![](../../users/profiles/110750.webp)
Wookie88
- 211
- 1
- 2
- 7
6
votes
1 answer
socat forwarding to multiple addresses
I have a single incoming video stream, and I'd like to set up multiple processes to handle it, each running at its own address. After some reading it seems socat is one way to do this
socat TCP4-LISTEN:1934,fork,reuseaddr TCP4:someaddress:1935…
![](../../users/profiles/454897.webp)
Shukri Adams
- 163
- 1
- 1
- 6
6
votes
2 answers
Windows/Linux socat to share a serial device over IP
I have a scenario where I demonstrated to my group @ work how to share a very expensive USB patient simulator plugged into a Raspberry Pi (Debian) using socat. The group wants to be able to have an on-demand, bi-directional connection to the serial…
![](../../users/profiles/165980.webp)
wxfield
- 61
- 1
- 1
- 2
6
votes
1 answer
Socat to share a serial link between multiple processes
I have a scenario where multiple processes on the same box want to communicate with a serial device. Process A needs two-way communications with the serial port, and Process B only needs to be able to write to the serial port. The serial device is…
![](../../users/profiles/130433.webp)
John Walthour
- 181
- 1
- 7
4
votes
3 answers
socat TCP file server
I'm trying to set up a simple socat fileserver using TCP to send small files (~100KB).
Here are the one-line servers and client for one file:
Server: socat -u -d -d OPEN:file.dat TCP-LISTEN:,reuseaddr,fork
Client: socat -u -d -d…
![](../../users/profiles/253807.webp)
jean-loup
- 127
- 2
- 9
4
votes
2 answers
socat connect-connect "proxy" two inbound TCP connections to expose a firewalled service?
I'm struggling a bit trying to see how to use socat (or a similar TCP port redirector) to expose a firewalled service on a PC.
Here's the scenario: I have a server PC which will be acting as a listen-listen "proxy" / redirector between two client…
![](../../users/profiles/69145.webp)
cjones26
- 276
- 1
- 6
- 18