{"id":13600256,"url":"https://github.com/ngrok/ngrok-go","last_synced_at":"2025-12-15T22:47:35.395Z","repository":{"id":59047591,"uuid":"519265820","full_name":"ngrok/ngrok-go","owner":"ngrok","description":"Embed ngrok secure ingress into your Go apps as a net.Listener with a single line of code.","archived":false,"fork":false,"pushed_at":"2025-04-03T20:00:04.000Z","size":680,"stargazers_count":746,"open_issues_count":11,"forks_count":78,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-04-11T22:53:16.169Z","etag":null,"topics":["go","golang","golang-library","ngrok"],"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/ngrok.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2022-07-29T15:36:58.000Z","updated_at":"2025-04-06T18:57:09.000Z","dependencies_parsed_at":"2023-07-18T01:51:46.308Z","dependency_job_id":"b2c4b604-5bab-4f2b-9ef5-100ab22d9e20","html_url":"https://github.com/ngrok/ngrok-go","commit_stats":{"total_commits":135,"total_committers":8,"mean_commits":16.875,"dds":0.3111111111111111,"last_synced_commit":"8acdd93580f44a0c6262fc59c92b5f58103141c4"},"previous_names":["ngrok/libngrok-go"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngrok%2Fngrok-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngrok%2Fngrok-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngrok%2Fngrok-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngrok%2Fngrok-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngrok","download_url":"https://codeload.github.com/ngrok/ngrok-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248759279,"owners_count":21157132,"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","golang","golang-library","ngrok"],"created_at":"2024-08-01T18:00:33.552Z","updated_at":"2025-12-15T22:47:35.355Z","avatar_url":"https://github.com/ngrok.png","language":"Go","funding_links":[],"categories":["Go","HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# ngrok-go\n\n[![Go Reference](https://pkg.go.dev/badge/golang.ngrok.com/ngrok.svg)](https://pkg.go.dev/golang.ngrok.com/ngrok)\n[![Go](https://github.com/ngrok/ngrok-go/actions/workflows/buildandtest.yml/badge.svg)](https://github.com/ngrok/ngrok-go/actions/workflows/buildandtest.yml)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ngrok/ngrok-rust/blob/main/LICENSE-MIT)\n\n\n[ngrok](https://ngrok.com) is a simplified API-first ingress-as-a-service that adds connectivity, security, and observability to your apps.\n\nngrok-go is an open source and idiomatic library for embedding ngrok networking directly into Go applications. If you’ve used ngrok before, you can think of ngrok-go as the ngrok agent packaged as a Go library.\n\nngrok-go lets developers serve Go apps on the internet in a single line of code without setting up low-level network primitives like IPs, certificates, load balancers and even ports! Applications using ngrok-go listen on ngrok’s global ingress network but they receive the same interface any Go app would expect (net.Listener) as if it listened on a local port by calling net.Listen(). This makes it effortless to integrate ngrok-go into any application that uses Go's net or net/http packages.\n\nSee [`examples/http/main.go`](/examples/http/main.go) for example usage, or the tests in [`online_test.go`](/online_test.go).\n\nFor working with the [ngrok API](https://ngrok.com/docs/api/), check out the [ngrok Go API Client Library](https://github.com/ngrok/ngrok-api-go).\n\n## Installation\n\nThe best way to install the ngrok agent SDK is through `go get`.\n\n```sh\ngo get golang.ngrok.com/ngrok\n```\n\n## Documentation\n\nA full API reference is included in the [ngrok go sdk documentation on pkg.go.dev](https://pkg.go.dev/golang.ngrok.com/ngrok). Check out the [ngrok Documentation](https://ngrok.com/docs) for more information about what you can do with ngrok.\n\nFor additional information, be sure to also check out the [ngrok-go launch announcement](https://ngrok.com/blog-post/ngrok-go)!\n\n## Quickstart\n\nFor more examples of using ngrok-go, check out the [/examples](/examples) folder.\n\nThe following example uses ngrok to start an http endpoint with a random url that will route traffic to the handler. The ngrok URL provided when running this example is accessible by anyone with an internet connection.\n\nThe ngrok authtoken is pulled from the `NGROK_AUTHTOKEN` environment variable. You can find your authtoken by logging into the [ngrok dashboard](https://dashboard.ngrok.com/get-started/your-authtoken).\n\nYou can run this example with the following command:\n\n```sh\nNGROK_AUTHTOKEN=xxxx_xxxx go run examples/http/main.go\n```\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"golang.ngrok.com/ngrok\"\n\t\"golang.ngrok.com/ngrok/config\"\n)\n\nfunc main() {\n\tif err := run(context.Background()); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\nfunc run(ctx context.Context) error {\n\tln, err := ngrok.Listen(ctx,\n\t\tconfig.HTTPEndpoint(),\n\t\tngrok.WithAuthtokenFromEnv(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlog.Println(\"Ingress established at:\", ln.URL())\n\n\treturn http.Serve(ln, http.HandlerFunc(handler))\n}\n\nfunc handler(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintln(w, \"Hello from ngrok-go!\")\n}\n```\n\n## Support\n\nThe best place to get support using ngrok-go is through the [ngrok Slack Community](https://ngrok.com/slack). If you find bugs or would like to contribute code, please follow the instructions in the [contributing guide](/CONTRIBUTING.md).\n\n## Changelog\n\nChanges to `ngrok-go` are tracked under [CHANGELOG.md](https://github.com/ngrok/ngrok-go/blob/main/CHANGELOG.md).\n\n## Join the ngrok Community\n\n- Check out [our official docs](https://docs.ngrok.com)\n- Read about updates on [our blog](https://ngrok.com/blog)\n- Open an [issue](https://github.com/ngrok/ngrok-go/issues) or [pull request](https://github.com/ngrok/ngrok-go/pulls)\n- Join our [Slack community](https://ngrok.com/slack)\n- Follow us on [X / Twitter (@ngrokHQ)](https://twitter.com/ngrokhq)\n- Subscribe to our [Youtube channel (@ngrokHQ)](https://www.youtube.com/@ngrokhq)\n\n## License\n\nngrok-go is licensed under the terms of the MIT license.\n\nSee [LICENSE](./LICENSE.txt) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngrok%2Fngrok-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngrok%2Fngrok-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngrok%2Fngrok-go/lists"}