{"id":48764205,"url":"https://github.com/crgimenes/devmux","last_synced_at":"2026-04-13T07:46:12.231Z","repository":{"id":292473650,"uuid":"981021448","full_name":"crgimenes/devmux","owner":"crgimenes","description":"Secure HTTP over SSH proxy that exposes multiple local dev services through one remote endpoint with Lua-configurable routing.","archived":false,"fork":false,"pushed_at":"2025-08-17T09:46:47.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2025-08-17T11:34:18.785Z","etag":null,"topics":["golang","http","lua","proxy","terminal"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crgimenes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-10T06:51:16.000Z","updated_at":"2025-08-17T09:46:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"a9ba957f-4a02-4ae4-abba-42ef72e0a5ed","html_url":"https://github.com/crgimenes/devmux","commit_stats":null,"previous_names":["crgimenes/devmux"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/crgimenes/devmux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crgimenes%2Fdevmux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crgimenes%2Fdevmux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crgimenes%2Fdevmux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crgimenes%2Fdevmux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crgimenes","download_url":"https://codeload.github.com/crgimenes/devmux/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crgimenes%2Fdevmux/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31744404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T06:26:45.479Z","status":"ssl_error","status_checked_at":"2026-04-13T06:26:44.645Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","http","lua","proxy","terminal"],"created_at":"2026-04-13T07:46:10.874Z","updated_at":"2026-04-13T07:46:12.213Z","avatar_url":"https://github.com/crgimenes.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# devmux - Development Multiplexer\n\n[![Go Version](https://img.shields.io/badge/Go-1.24+-blue.svg)](https://golang.org/doc/install)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA powerful reverse tunnel proxy tool that creates secure tunnels to remote servers and intelligently routes HTTP requests to local development ports. Perfect for exposing multiple local services through a single remote endpoint.\n\n## Features\n\n- **Secure SSH Tunneling**: Create encrypted reverse tunnels using SSH with key-based authentication.\n- **Intelligent HTTP Routing**: Route requests to different local ports based on URL paths.\n- **Lua Configuration**: Flexible configuration system with Lua scripting support.\n- **Request Logging**: Detailed logging of HTTP requests with colored output for better debugging.\n- **SSH Agent Support**: Seamless integration with SSH agent for key management.\n- **Multi-Service Support**: Expose multiple local development services through one tunnel.\n- **Keep-Alive**: Automatic connection maintenance to prevent tunnel timeouts.\n\n## Installation\n\n### From Source\n\n```bash\ngit clone https://github.com/crgimenes/devmux.git\ncd devmux\ngo build -o devmux .\n```\n\n### Requirements\n\n• Go 1.24 or higher\n• SSH access to a remote server\n• SSH key configured for authentication\n\n## Quick Start\n\n1. **Create your configuration file**:\n\n   ```bash\n   mkdir -p ~/.config/devmux\n   ```\n\n2. **Configure your routes** (`~/.config/devmux/init.lua`):\n\n   ```lua\n   Host       = \"your-server.com\"\n   RemotePort = \"10000\"\n   Routes     = {\n       [\"api\"]     = \"3000\",  -- Routes /api to localhost:3000\n       [\"web\"]     = \"8080\",  -- Routes /web to localhost:8080\n       [\"admin\"]   = \"9000\",  -- Routes /admin to localhost:9000\n   }\n   ```\n\n3. **Start the tunnel**:\n\n   ```bash\n   ./devmux\n   ```\n\n4. **Access your services**:\n   - `http://your-server.com:10000/api` → `localhost:3000`\n   - `http://your-server.com:10000/web` → `localhost:8080`\n   - `http://your-server.com:10000/admin` → `localhost:9000`\n\n## Configuration\n\ndevmux uses Lua for configuration, providing powerful customization options. The configuration file should be placed at `~/.config/devmux/init.lua` or as `devmux_init.lua` in your current directory.\n\n### Basic Configuration\n\nConfigure your remote server with a reverse proxy to a port.\n\nCaddyfile example `/etc/caddy/Caddyfile`:\n\n```\nserver.example.com {\n\treverse_proxy 127.0.0.1:10000\n}\n```\n\nLocal configuration file (`~/.config/devmux/init.lua`):\n\n```lua\n-- Remote server settings\nHost = \"your-remote-server.com\"\nRemotePort = \"10000\"\n\n-- Route configuration\nRoutes = {\n    [\"api\"] = \"3000\",      -- API service on port 3000\n    [\"web\"] = \"8080\",      -- Web frontend on port 8080\n    [\"docs\"] = \"4000\",     -- Documentation on port 4000\n    [\"metrics\"] = \"9090\",  -- Monitoring on port 9090\n}\n```\n\n### Route Patterns\n\nRoutes are defined as path prefixes that map to local ports:\n\n```lua\nRoutes = {\n    [\"app\"]        = \"3000\",  -- /app/* → localhost:3000/*\n    [\"api/v1\"]     = \"8001\",  -- /api/v1/* → localhost:8001/*\n    [\"api/v2\"]     = \"8002\",  -- /api/v2/* → localhost:8002/*\n    [\"static\"]     = \"8080\",  -- /static/* → localhost:8080/*\n    [\"websocket\"]  = \"3001\",  -- /websocket/* → localhost:3001/*\n}\n```\n\n## How It Works\n\n1. **The remote http server** listens http and https requests and redirects them to the 10000 port.\n2. **SSH Tunnel Creation**: devmux establishes a reverse SSH tunnel to your remote server at port 10000.\n3. **HTTP Proxy Server**: A local HTTP server captures incoming requests from the tunnel\n4. **Route Matching**: Requests are analyzed and routed based on URL path prefixes\n5. **Local Forwarding**: Matched requests are proxied to the corresponding local port\n6. **Response Relay**: Responses are sent back through the tunnel to the client\n\n## Use Cases\n\n### Development Environment Exposure\n\nExpose your local development stack to remote collaborators or testing environments:\n\n```lua\nRoutes = {\n    [\"frontend\"] = \"3000\",    -- React/Vue/Angular dev server\n    [\"backend\"]  = \"8000\",    -- API server\n    [\"db-admin\"] = \"8080\",    -- Database administration tool\n}\n```\n\n## SSH Configuration\n\ndevmux respects your SSH configuration and supports:\n\n• **SSH Agent**: Automatic key discovery through SSH agent\n• **SSH Config**: Uses `~/.ssh/config` for host-specific settings\n• **Known Hosts**: Validates server identity using `~/.ssh/known_hosts`\n• **Key Files**: Direct SSH key file specification\n\n### Example SSH Config\n\n```ssh\nHost your-server.com\n    User your-username\n    Port 22\n    IdentityFile ~/.ssh/id_rsa\n    ServerAliveInterval 60\n    ServerAliveCountMax 3\n```\n\n## Troubleshooting\n\n### Common Issues\n\n#### Connection Refused\n\n- Verify your SSH credentials and server access\n- Check if the remote port is available and not blocked by firewall\n\n#### Route Not Working\n\n- Ensure your local service is running on the specified port\n- Check that the route path matches your request URL\n\n#### SSH Key Issues\n\n- Verify your SSH key is added to the SSH agent: `ssh-add -l`\n- Test SSH connection manually: `ssh your-server.com`\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Author\n\nCreated by [Cesar Gimenes](https://github.com/crgimenes)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrgimenes%2Fdevmux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrgimenes%2Fdevmux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrgimenes%2Fdevmux/lists"}