1
0
Fork 0
mirror of synced 2026-11-06 04:09:00 +05:30
Mirror of tuxdotrs/trok
  • Go 41.5%
  • TypeScript 35.6%
  • Nix 13.5%
  • HTML 5.4%
  • Shell 2.7%
  • Other 1.3%
Find a file
2026-09-28 17:48:50 +05:30
.github/workflows ops: create release.yml 2025-02-27 23:01:49 +05:30
cmd feat: add cli option to pass custom remote port 2026-01-27 17:31:19 +05:30
internal refactor(server): remove autocert tls setup 2026-09-07 21:19:25 +05:30
nix chore(nix): update go vendor hash 2026-09-28 17:48:50 +05:30
.gitignore chore: remove dist folder 2025-03-10 17:21:34 +05:30
flake.lock refactor(nix): migrate flake to flake-parts 2026-09-08 04:28:48 +05:30
flake.nix refactor(nix): migrate flake to flake-parts 2026-09-08 04:28:48 +05:30
go.mod feat: add automatic ssl certificate 2025-03-04 00:47:01 +05:30
go.sum feat: add automatic ssl certificate 2025-03-04 00:47:01 +05:30
LICENSE doc: update LICENSE 2025-07-05 00:07:55 +05:30
main.go refactor: change mod name 2025-02-28 03:15:05 +05:30
README.md fix(docs): correct nix service configuration 2026-09-07 20:41:12 +05:30

trok

Accessing your local service should be simple

wakatime home GitHub repo size GitHub commit activity

Table of Contents

Features

  • TCP Tunneling
  • UDP Tunneling (planned)
  • HTTP Tunneling
  • HTTPS Tunneling (planned)

Installation

curl -fsSL https://trok.cloud/install.sh | sh

Nix

# If you want to quickly test trok
nix run github:tuxdotrs/trok

Flake

# 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 ];

Usage

Start a TCP tunnel:

trok tcp PORT_NUMBER

Example:

trok tcp 3000

Selfhosted Server:

trok tcp 3000 -s SERVER_URL

This will expose your local service running on port 3000 to a public endpoint via the trok server.

Selfhost

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
  ];

  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.