Share local services
flowmesh serve shares an HTTP service or TCP port on the current machine with devices in the mesh network that are allowed to access it. It doesn’t publish the service directly to the internet.
The examples below apply to the Linux FlowMesh client. First confirm that the current machine has joined the mesh network and has an HTTP service running locally on 127.0.0.1:3000.
1. Check the local service
curl http://127.0.0.1:3000If local access also fails, start or fix the service first, then set up sharing.
2. Share an HTTP service
Forward port 8080 on the mesh network to local port 3000:
sudo flowmesh serve --bg --http=8080 http://127.0.0.1:3000--bg saves the configuration in the background, so it stays in use after a restart. Without it, the command runs in the foreground, and sharing ends when you stop the command.
View the background configuration:
flowmesh serve status3. Access from another device
On another device in the same mesh network that is allowed to access port 8080 on this node, open the HTTP address shown in the command output. That device needs to be able to resolve the serving node’s DNS name.
HTTP Serve matches requests by node name. Using the mesh IP directly in the URL may return 404 page not found, so use the name and port from the output.
Verify from another mesh network device; successfully reaching the background service locally doesn’t mean the mesh network access policy is configured correctly.
Stop sharing
Remove the background HTTP share above:
sudo flowmesh serve --bg --http=8080 offsudo flowmesh serve reset clears all background sharing configuration; check serve status before running it.
Share a TCP port
For example, if a local service is already listening on 127.0.0.1:7000, you can forward it through mesh network port 9000:
sudo flowmesh serve --bg --tcp=9000 tcp://127.0.0.1:7000Application clients connect to the serving node’s mesh IP address or name on port 9000. To stop, run sudo flowmesh serve --bg --tcp=9000 off.
Limitations and troubleshooting
- You must explicitly choose
--httpor--tcp; HTTPS sharing, TLS termination and public publishing are not currently available. - The forwarding target must be a service on the current machine. To reach another LAN device, use subnet routes.
502 Bad Gatewayusually means the local backend is unreachable; check the service and port.- For
404, check that the request uses the node name and that the shared path matches. - Only configurations made with
--bgappear inserve status; temporary foreground shares are not in that list.
For more connection problems, see Troubleshooting.