{"id":14563553,"url":"https://github.com/mkmik/udig","last_synced_at":"2025-03-15T14:30:50.994Z","repository":{"id":37085967,"uuid":"159374772","full_name":"mkmik/udig","owner":"mkmik","description":"public-key addressed TCP tunnel broker","archived":false,"fork":false,"pushed_at":"2024-10-29T08:19:23.000Z","size":3425,"stargazers_count":51,"open_issues_count":7,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-29T09:39:16.707Z","etag":null,"topics":["go","networking","proxy","tcp","tunnel"],"latest_commit_sha":null,"homepage":null,"language":"Jsonnet","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkmik.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-27T17:36:38.000Z","updated_at":"2024-10-25T23:13:10.000Z","dependencies_parsed_at":"2023-09-27T19:41:30.918Z","dependency_job_id":"84d50c05-b9cf-41de-ac9c-ec94dba1132f","html_url":"https://github.com/mkmik/udig","commit_stats":{"total_commits":609,"total_committers":6,"mean_commits":101.5,"dds":0.3579638752052545,"last_synced_commit":"87ee54949537831ed6c4f588e494ab9d735bc9a1"},"previous_names":["bitnami-labs/udig"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkmik%2Fudig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkmik%2Fudig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkmik%2Fudig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkmik%2Fudig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkmik","download_url":"https://codeload.github.com/mkmik/udig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243742678,"owners_count":20340685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["go","networking","proxy","tcp","tunnel"],"created_at":"2024-09-07T02:02:44.793Z","updated_at":"2025-03-15T14:30:49.703Z","avatar_url":"https://github.com/mkmik.png","language":"Jsonnet","funding_links":[],"categories":["proxy"],"sub_categories":[],"readme":"# udig\n\n[![Build Status](https://img.shields.io/github/workflow/status/mkmik/udig/CI)](https://github.com/mkmik/udig/actions)\n[![Go Report Card](https://goreportcard.com/badge/github.com/mkmik/udig)](https://goreportcard.com/report/github.com/mkmik/udig)\n\nudig is a public-key addressed TCP tunnel software. It allows anybody to expose a local network\nservice through a public stable ingress, even if the local service is behind a NAT or firewall.\n\n\n\u003e This project is still under heavy work in progress\n\n## Background\n\nThere are things like ngrok and other commercial software.\nudig is suitable for automation because users don't need to create any account.\n\n## How it works\n\n![architecture](doc/arch.png)\n\nIt has of two logical endpoints:\n\n* **uplink**: clients building a tunnel open a TCP connection to our servers and sets up a gRPC service listening on the client connection (yep in reverse; nothing new).\n* **ingress**: another endpoint is for connections entering the tunnel; traffic is then forwarded to any active uplink active matching a tunnel ID encoded in the TLS SNI field.\n\n\nTunnel IDs are base32 encoded hashes of the public key (technically a [multihash](https://github.com/multiformats/multihash) encoded as a base32 [multibase](https://github.com/multiformats/multibase)).\n\nTunnel ingress addresses look like this: bahwqcerazdp76ea6rpuwvbbwxkjtypdntmw4bohi6amkzkfz2kswpxlpgykq.udig.io\n\n## Install\n\n```\n$ go get -u github.com/mkmik/udig/...\n```\n\n## Client usage\n\nShell 1:\n```\n$ udiglink -R 443:localhost:8080\nhttps://bahwqcerazdp76ea6rpuwvbbwxkjtypdntmw4bohi6amkzkfz2kswpxlpgykq\n```\n\nShell 2:\n```\n$ python3 -m http.server 8080\nServing HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...\n```\n\nShell 3:\n```\n$ curl https://bahwqcerazdp76ea6rpuwvbbwxkjtypdntmw4bohi6amkzkfz2kswpxlpgykq.udig.io/README.md\n# udig\n...\n```\n\n## Run locally\n\nShell 1:\n```\n$ (cd cmd/udiglink \u0026\u0026 go build \u0026\u0026 ./udiglink -alsologtostderr -addr localhost:4000 -http :8081 -R 8443:localhost:1234)\n```\n\nShell 2:\n```\n$ (cd cmd/udigd \u0026\u0026 go build \u0026\u0026 ./udigd -alsologtostderr -http :8001 -port 8080 -port 8443 -cert ../../pkg/ingress/testdata/cert.pem -key ../../pkg/ingress/testdata/key.pem)\n```\n\nShell 3:\n```\n$ python3 -m http.server 1234\n```\n\nShell 4:\n```\n$ curl --connect-to ::127.0.0.1:8443 -k https://bahwqcerazdp76ea6rpuwvbbwxkjtypdntmw4bohi6amkzkfz2kswpxlpgykq.udig.io/README.md\n```\n\n(use the actual hostname you get in `tunnel ingress addresses: [\"bahw....` in Shell 1 for ^^^)\n\n\u003e NOTE: This command requires `curl` version 7.49.0 or above.\n\nFor earlier versions of `curl` this can be tested by adding the host to `/etc/hosts` file as `127.0.0.1` (or `C:\\Windows\\System32\\drivers\\etc\\hosts` on Windows) - like:\n```\n127.0.0.1 bahwqcerazdp76ea6rpuwvbbwxkjtypdntmw4bohi6amkzkfz2kswpxlpgykq.udig.io\n```\n\nAnd then running the curl command with port 8443:\n\n```\ncurl https://bahwqcerazdp76ea6rpuwvbbwxkjtypdntmw4bohi6amkzkfz2kswpxlpgykq.udig.io:8443/README.md\n```\n\n## Off-the-shelf tunnel client example\n\nUdig forces you to use a TLS client and one that supports SNI nonetheless!\nIf you have a plaintext TCP client on one side that needs to talk to a plaintext TCP  server on the other side of the tunnel, this is an example of how you can setup the client side of the tunnel with standard off the-shelf-tools:\n\n```\n$ echo \"openssl s_client -quiet -connect $DST:$PORT -servername $DST\" \u003e/tmp/cmd.sh\n$ chmod +x /tmp/cmd.sh\n$ socat TCP-LISTEN:1234,reuseaddr,fork 'SYSTEM:/tmp/cmd.sh' \u0026\n```\n\n\n## Contributing\n\nPRs accepted\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkmik%2Fudig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkmik%2Fudig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkmik%2Fudig/lists"}