Accessing your local service should be simple
- TCP Tunneling
- UDP Tunneling (planned)
- HTTP Tunneling
- HTTPS Tunneling (planned)
curl -fsSL https://trok.cloud/install.sh | sh# If you want to quickly test trok
nix run github:tuxdotrs/trok# Add to your flake inputs
trok = {
url = "github:tuxdotrs/trok";
inputs.nixpkgs.follows = "nixpkgs";
};
# Add this in your nixos config
environment.systemPackages = [ inputs.trok.packages.${system}.default ];Start a TCP tunnel:
trok tcp PORT_NUMBERExample:
trok tcp 3000Selfhosted Server:
trok tcp 3000 -s SERVER_URLThis will expose your local service running on port 3000 to a public endpoint via the trok server.
You can host your own trok server with NixOS:
# Add to your flake inputs
trok = {
url = "github:tuxdotrs/trok";
inputs.nixpkgs.follows = "nixpkgs";
};
# Add this in your nixos config
{inputs, ...}: {
imports = [
inputs.trok.nixosModules.default
];
tux.services.trok = {
enable = true;
host = "0.0.0.0";
port = 1337;
openFirewall = true;
user = "trok";
group = "trok";
};
}Once deployed, your trok server will be ready to handle tunneling requests from clients.