Questions tagged [socat]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
29 views

How to measure network throughput with IPerf3 and multiple socat proxies

I have a particular device which acts as a "strange" TLS proxy and I want to measure the throughput of it with IPerf3. The device under test is "Peter". It has an API to trigger ...
1 vote
1 answer
2k views

Using socat forwarder over HTTP tunnel (CONNECT) over SSL/TLS

For context, i am using nginx's reverse proxy ngx_http_proxy_module to cache content from an upstream https server. For a specific project, i need nginx to pass through a corporate HTTP proxy (using ...
0 votes
2 answers
1k views

Fork connections out from a single socat connection

I have an old legacy application I’m trying to get to work with our semi-modern network. This application sends log messages as HTTP requests (one log per request) but does so over a single TCP ...
0 votes
0 answers
63 views

iptables as proxy server for IoT devices similar to socat

I am able to forward incoming TCP traffic from IoT devices hitting a port towards another destination server using socat using this command socat TCP-LISTEN:5050,reuseaddr,fork TCP:some-random-host-in-...
45 votes
7 answers
55k views

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 ...
0 votes
1 answer
757 views

K8s Port Forwarding via kubectl and socat

My k8s pod is connecting to a certain https target. This target is not reachable from my local machine, so I wanted to use kubectl proxy + socat to make that target available on my local machine für ...
1 vote
1 answer
586 views

End of line after socat readbytes limit is reached

We wanted to use socat to make a process available that is line-based: socat SYSTEM:"echo \$\$;sed -u /^%/s/foo/bar/" \ TCP-L:1234,fork,reuseaddr,readbytes=21,bind=localhost This works but only ...
7 votes
2 answers
13k views

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-...
0 votes
0 answers
135 views

using putty and socat to run rust server behind firewalls

i want to run a publicly accessible Rust server on a windows machine behind some routers and firewalls. the idea is tunneling the local server ports to a public machine where they are accessable: rust ...
0 votes
1 answer
291 views

socat is missing commands for haproxy on ubuntu 20.04

I have installed haproxy 2.6.6, socat 1.7.4.1 and have a working load balancer for Exchange. I want to be able to turn off a node for maintenance and have unsuccessfully tried to use socat to do this. ...
0 votes
1 answer
1k views

Socat udp client/server with truncated message

Using nodejs I can transmit udp packets with a payload of 50000 chars. But I fail to do so with socat (Linux ubuntu 20.04 on both the client and server). For this test I've been using a vpn connecting ...
2 votes
1 answer
2k views

What is needed to use kubernetes port forwarding through a proxy?

I have a kubernetes cluster that I can reach through an nginx proxy. I can do kubectl get deployments -n kube-system without issue. However, I'm trying to use helm. Helm is throwing an error: ...
0 votes
0 answers
2k views

SOCAT command for UDP relay using single port

I am using SOCAT linux command for relaying udp packets. Currently I am simulating using VMware. I used sudo socat -T 10 UDP4-LISTEN:132,reuseaddr,fork UDP4:192.168.11.130:130,bind=192.168.11.131:133 ...
1 vote
1 answer
1k views

What is the iptables equivalent to what socat does?

What is the iptables equivalent to the following? socat TCP-LISTEN:8080 TCP:some-random-host-in-another-network.com:80 Now multiple clients can connect to port 8080 of this middle host to actually ...
0 votes
1 answer
456 views

haproxy as a ipv4 to ipv6

i have a small linux server on the internet on which i run socat. socat UDP4-LISTEN:1194,fork UDP6-SENDTO:[****:****:****:****:*** *:****:****:****]:1194 Which I installed as a service. So far it ...
7 votes
1 answer
17k views

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 ...
5 votes
1 answer
3k views

socat tun device very low throughput

I was tinkering around with socat and tried to use socat for creating a TUN device for tunneling between two debian stretch servers. However, throughput seemed very low and comparing with iperf ...
4 votes
3 answers
6k views

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:<port&...
0 votes
0 answers
374 views

UDP to Serial port

I look for some solution for connect serial/UART port by UDP connection to another PC. Now I use socat and have connection , but with lost packages, and slow transfer. Can I use netcat for this, maybe ...
2 votes
1 answer
4k views

Socat - is it possible?

Is there any way to listen and execute a command ( for every connection ) while port forwarding with socat? A non-working example to make it more clear: socat TCP-LISTEN:8080,reuseaddr, "exec:ls&...
1 vote
0 answers
660 views

'socat' not displaying incoming UDP packets, but Wireshark does

The link is an image of a Wireshark dump of an incoming 60-byte Ethernet frame which contains a UDP packet. The packet payload is the single word 'hello' (sorry, I don't have enough rep to paste the ...
1 vote
0 answers
2k views

ping packet loss in wireguard UDP over TCP + UDP over socat tunnels

I have a wireguard tunnel mostly working between two Debian systems, but I had to workaround a ISP firewall (firewall X in the diagram below) that blocks everything inbound and prevents Server B from ...
7 votes
1 answer
43k views

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 ...
1 vote
1 answer
2k views

How to capture UDP traffic so it can be piped to grep

I'm trying to capture UDP traffic which is being sent as StatsD metrics (on port 8125). The most simple approach I tried is to run nc -ul 8125 which prints the metrics to the terminal...but they are ...
1 vote
1 answer
2k views

Invoke remote program with socat and wait for it to complete

I need to invoke a program x on server foo from client bar. Program x takes some time to load, then reads input from stdin and transmits output to stdout before terminating. I've been trying to use ...
1 vote
0 answers
696 views

Simple socat UDP6 relay test setup not working

I'd like to use socat as a relay to let two players (both behind firewalls) of my game connect to each other. The game engine uses UDP. Player A will host the game server, player B will join as client,...
0 votes
0 answers
217 views

Socat device disappears

On Ubuntu 18.04, I'm using socat to connect to a USB device physically attached to another machine (and exposed via ser2net): sudo socat PTY,link=/dev/zwavevera,group=root,mode=777 TCP:vera.home.lan:...
7 votes
1 answer
12k views

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 ...
1 vote
0 answers
55 views

Encapsulate udp traffic info tcp with on-disk buffering

My ipfix flow receiver supports only udp (can't be replaced), which is not resistant to network failures and then I'm loosing flow data. To improve this I'm thinking about using socat, mkfifo between ...
0 votes
1 answer
2k views

how to create a tar file with checksums, but without compression

(note, this is not a duplicate of Creating a tar file with checksums included) I'm familiar with using tar + gzip to create a compressed tar file (tar cf - files | gzip > something.tar.gz), and ...
1 vote
2 answers
5k views

How to tunnel the serial port from a remote machine?

I'm trying to access a remote serial console (a tty port on a remote machine) as if it's on a local machine. This is necessary for a serial-port only application to work on my machine. The remote tty ...
0 votes
1 answer
199 views

Network shaping local proxy for website testing

I want to make a virtual network interface to TCP-proxy a website and have my browser see it through a slow network connection, in order to debug performance issues in the website itself. So far I ...
11 votes
2 answers
3k views

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, ...
0 votes
0 answers
1k views

Why is socat not working here? (4in6 for UDP traffic)

I have a TS3 server running on IPv6 only. I wanted to use a dualstack VPS as a 4in6 tunnel, but UDP traffic gets lost with this configuration: socat UDP4-LISTEN:9987,fork UDP6:[email protected]:9987 ...
0 votes
0 answers
1k views

forward all traffic between two ports without iptables

I have read this: Port forwarding on Linux without iptables? I have a vps and I have ran lxc containers on it. I want to redirect all incoming traffic from one outside port to one port of a container ...
1 vote
0 answers
952 views

socat multiple reads from pipe via SSH

I would like to read input on a named pipe on a remote server from my local machine. I have a script on the remote server that is triggered as a CRON job. So every now and then by script writes ...
1 vote
1 answer
6k views

Is it possible to make a web browser proxy tunnel with Netcat/Socat?

Concerning the Netcat/Socat utility . From the man page, it seems like it is possible to create a secure proxy using netcat by which I could point my web browser to like a proxy server , that could ...
1 vote
1 answer
6k views

Forwarding SNMP ports over SSH

I access my work network through a VPN and have access to every host in there through SSH. Currently I need to access around 3000 hosts via SNMP, but corporate sec policies restrict SNMP access ...
1 vote
0 answers
994 views

Socat interacting with specific host (reverse shell) from mutiple clients/connections

I have a threaded c/c++ application that gives a pty reverse shell installed on multiple linux clients they all connect back to same server/port now I need to find a reliable method to interact with a ...
0 votes
1 answer
160 views

Setting up a three way serial port from a single existing port

I currently have a device that has a serial port, and on boot this serial port is bound to ttyS1. There is a process on the device (that I have little control over) that takes control of this port so ...
35 votes
6 answers
76k views

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 ...
2 votes
1 answer
5k views

IPv4 to IPv6 proxy/passthrough

I recently had an app rejected from the ios store for crashing during their (now) mandatory IPv6 test (didn't even know they did that). My server (on AWS) wasn't setup for IPv6, but I've fixed that ...
4 votes
1 answer
2k views

Can socat be used to forward an ssh-agent socket into a chroot?

I'm building custom Debian environments on a remote server, which I connect to over SSH. This involves building a debootstrap environment, then chrooting into it to run a custom installer. As part of ...
2 votes
1 answer
9k views

socat udp packet forwarding with source address

I am trying to use socat (instead of iptables) for UDP port forwarding. I just need to redirect some traffic from UDP port 162 to 33162. I am using something like this: socat udp-listen:162,pktinfo,...
2 votes
1 answer
6k views

UDP multicast send/receive: Routing or socat issues?

I'm using 'socat' on Linux Centos 7 to diagnose some problems. Server and clients are all linux centos7, they all have multiple interfaces. Server 10.1.1.1 is on Switch 1, 10.1.1.2 is on Switch 2. ...
0 votes
0 answers
1k views

multiplexing a TCP connection through a dumb shell connection?

I am connecting to a VPN whose gateway is sufficiently misconfigured that basically the only useful thing I can do with it is to ssh to a specific Linux host set up for my usage inside the VPN, and ...
1 vote
1 answer
2k views

socat CREATE returning Bad file descriptor

I'm trying to build a quick script which listens for one UDP packet, stores it to a file, and exits. socat to the rescue! $ socat UDP-RECVFROM:9999 CREATE:/tmp/results_9999 2016/04/08 11:56:59 socat[...
2 votes
0 answers
1k views

socat Resource temporarily unavailable

I am using socat as a bridge between some devices and running socat (a couple hundreds of instances) like this: socat -d -d -d -x -d -lf "/var/log/some_log_file" TCP4-LISTEN:6126,fork,max-children=1,...
0 votes
0 answers
614 views

zabbix_agent + socat hanging with close_wait

I have the following setup: remote devices running active zabbix_agentd (version 2.0) using socat to tunnel through an HTTPS proxy. On the server side: Apache with a proxy service allowing CONNECT to ...
2 votes
0 answers
653 views

use socat to provide password to bsign

I have many servers, where I deploy various binaries. For this purpose I use a script that packs them into archives, publishes to the local repository and then ssh-es to the target servers and ...