{"id":44774989,"url":"https://github.com/crackcomm/onion","last_synced_at":"2026-02-16T06:35:41.910Z","repository":{"id":65518340,"uuid":"411080007","full_name":"crackcomm/onion","owner":"crackcomm","description":null,"archived":false,"fork":false,"pushed_at":"2021-09-28T00:09:23.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T03:31:24.026Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/crackcomm.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}},"created_at":"2021-09-28T00:08:01.000Z","updated_at":"2024-06-20T03:31:24.027Z","dependencies_parsed_at":"2023-01-27T00:30:26.969Z","dependency_job_id":null,"html_url":"https://github.com/crackcomm/onion","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/crackcomm/onion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crackcomm%2Fonion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crackcomm%2Fonion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crackcomm%2Fonion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crackcomm%2Fonion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crackcomm","download_url":"https://codeload.github.com/crackcomm/onion/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crackcomm%2Fonion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29501919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T05:57:17.024Z","status":"ssl_error","status_checked_at":"2026-02-16T05:56:49.929Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2026-02-16T06:35:41.451Z","updated_at":"2026-02-16T06:35:41.901Z","avatar_url":"https://github.com/crackcomm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# onion\n\n[![GoDoc](https://godoc.org/github.com/crackcomm/onion?status.svg)](https://godoc.org/github.com/crackcomm/onion)\n\nMake an onion made of net and crypto layers.\n\n```Go\no := onion.New(\n  net.NewLayer(),\n  tor.NewLayer(\n    tor.WithPort(80), // Hidden service port\n    tor.WithBin(\"/usr/bin/tor\"),\n    tor.WithVerbose(true),\n  ),\n  sch.NewLayer(\n    sch.WithPubKey(readPubKey()),\n    sch.WithPrivKey(readPrivKey()),\n  ),\n  tls.NewLayer(\n    tls.WithCertKeyFile(\"ca.pem\", \"ca.key\"),\n  ),\n  sch.NewLayer(\n    sch.WithPubKey(readPubKey()),\n    sch.WithPrivKey(readPrivKey()),\n  ),\n  sch.NewLayer(\n    sch.WithPubKey(readPubKey()),\n    sch.WithPrivKey(readPrivKey()),\n  ),\n)\n```\n\n## TOR Hidden service\n\nTo create a tor hidden service, all You need to do is create an Onion:\n\n```Go\no := onion.New(\n  net.NewLayer(),\n  tor.NewLayer(\n    tor.WithPort(80), // Hidden service port\n    tor.WithBin(\"/usr/bin/tor\"),\n  ),\n)\n```\n\nThen you can start listening through TOR:\n\n```Go\nlistener, err := o.Listener(nil)\nif err != nil {\n\tglog.Fatal(err)\n}\n\n// Will output {address}.onion\nglog.Infof(\"Listening on %s\", listener.Addr())\n\nfor {\n\tc, err := listener.Accept()\n\tif err != nil {\n\t\tglog.Warning(err)\n\t\tcontinue\n\t}\n\n\tgo serve(c)\n}\n```\n\nYou can also dial to TOR `.onion` services using this Onion:\n\n```Go\nconn, err := o.Connect(\"{address}.onion\", time.Minute)\nif err != nil {\n\tglog.Fatal(err)\n}\n\nconn.Write([]byte(\"Hello world!\\n\"))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrackcomm%2Fonion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrackcomm%2Fonion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrackcomm%2Fonion/lists"}