socat creates connections between two end point data streams. Think of it as "cat" for sockets (and more). You connect one end to something that streams a sequence of bytes and the other end to another.
There are dozens of examples in the Examples section:
Search the page for serial
for examples connection to a serial device.