Share a TCP Server Using malai

Starting malai-0.2.3. You can share your local TCP server with the world. This can be your database server or ssh server for example.

Assuming a tcp server is running on your local machine on port 5432, you can use the following command to share it:
Malai Expose TCP
$ malai tcp 5432 --public
Malai: Sharing port 5432
Run malai tcp-bridge <id52> <some-port>
to connect to it from any machine.
Lang:
bash
Now anyone can connect to this exposed server from their machine using the jommand:
Connect to TCP Server
$ malai tcp-bridge <id52> 9091
Listening on 127.0.0.1:9091
Lang:
bash

This will start a TCP server on their computer and they'll use this TCP server as if they're connecting to your real TCP server running on port 5432.

So if it's a postgres server, they can connect to it using the following command:
Connect to TCP Server
psql 'postgresql://user:passwd@localhost:9091/db_name'
Lang:
bash
And it'll connect to your postgres server listening on port 5432 on your machine!
© 2025 FifthTry, Inc