Zrok TCP connection on Public

We are self hosting Zrok and We wanted to expose TCP connection using Zrok through public sharing instead of Private. Is this functionality available?

It's not currently available in core zrok. In order to implement something like this, there needs to be some kind of framework for managing IP addresses and allocating IP/port pairs to specific public shares. This kind of implementation is necessarily tightly coupled with the infrastructure being used to provide those IP addresses and ports.

If you were using AWS to provide that infrastructure, then there would need to be code automating that when someone does a zrok share public -b tcpTunnel, which allocates and IP address and sets up the appropriate security groups, etc. Also keep in mind that once someone uses a specific port number on an IP address, if someone else wants to use that port number, then zrok would need to somehow acquire another IP address to use.

It gets complicated fast.

You can build something like this yourself by sharing with a private share, and then using zrok access private and binding it to a public IP address.

There is a video on personalized frontends that explains and demonstrates this in more detail:

I would expect at some point during the 1.x release series (starting this year), that we'll include specific extension points that will make this kind of implementation easier... but it's not on the immediate roadmap.

Let me know if there are any additional questions I can answer...

Here's the self-hosting documentation to accompany that video: Personalized Frontend | Zrok

Essentially, wherever you run zrok access private, you are self-hosting a personalized frontend for the zrok private share on a specified bind address and port (default is 127.0.0.1:9191). This allows you to bring your own public IP address and DNS for the frontend, e.g., to publish a private share with mode tcpTunnel on a public IP.