Turns out socat can be used to achieve this:
socat TCP-LISTEN:1234,reuseaddr,fork UNIX-CLIENT:/tmp/foo
And with a bit of added security:
socat TCP-LISTEN:1234,bind=127.0.0.1,reuseaddr,fork,su=nobody,range=127.0.0.0/8 UNIX-CLIENT:/tmp/foo
These examples have been tested and work as expected.
- How to forcibly close a socket in TIME_WAIT?
- What is the “slash” after the IP? [duplicate]
- Difference between UNIX domain STREAM and DATAGRAM sockets?
- How do SO_REUSEADDR and SO_REUSEPORT differ?
- Freeing up a TCP/IP port? [closed]
- Sockets found by lsof but not by netstat
- Monitor network traffic volume over interface
- I’m designing a system to handle 10000 TCP connections per second, what problems will I run into?
- Determining at what time a currently open TCP connection was created?
- Securing an Entry-Level Admin Job [duplicate]
- TCP monitoring on a server: comparing netstat vs lsof?
- Simple Socket Server in Bash?
- How many socket connections possible?
- When should I use TCP_NODELAY and when TCP_CORK?
- tcp_tw_reuse vs tcp_tw_recycle : Which to use (or both)?
- How does ngrok work behind a firewall?
- How to close a socket left open by a killed program?
- IPv6 address by hostname [closed]
- Where can I set environment variables that crontab will use?
- How do you get sudo access for a file inside the vi text editor? [closed]
- How to kill a child process after a given timeout in Bash?
- Turn a simple socket into an SSL socket
- Rename all files in a folder with a prefix in a single command
- Bash Scripting – How to set the group that new files will be created with?
- What is the difference between a soft (symbolic) link and a hard link?
- How to get e-mail from (failed) cron-jobs in Ubuntu?
- Why is Linux more popular than BSD? [closed]
- Why can’t I ssh into my new EC2 Instance?
- Linux – use “su -” but keep the current directory
- Does directory mtime always change when a new file is created inside?
- What *nix based command can I use to find my external IP?
- multiple physical interfaces with IPs on the same subnet
- What is the best way to measure latency via a “telnet to port” test, preferably with built-in Linux tools?
- Pick the default network interface
- Jumbo frames between KVM guest and host?
- arp-requests cannot be seen by specific nodes
- shell script to kill the process listening on port 3000? [duplicate]
- How to instruct cron to execute a job every second week?
- Replace the first line in a text file by a string
- How do I find all the files that were created today in Unix/Linux?
- Location of ini/config files in linux/unix?
- Must my pidfile be located in /var/run?
- DNS caching in Linux [closed]
- Abuse cURL to communicate with Redis
- How do I delete virtual interface in Linux? [closed]
- Can I open a socket and pass it to another process in Linux
- check if environment variable is already set [duplicate]
- How do I keep colors when piping “jq” output to “less”?
- How to grep exact literal string (no regex)
- Possible values for `uname -m`