{"id":22198155,"url":"https://github.com/sunaipa5/reqtor","last_synced_at":"2025-07-28T09:33:21.736Z","repository":{"id":239159624,"uuid":"797202796","full_name":"sunaipa5/reqtor","owner":"sunaipa5","description":"Library for making http requests over the tor network","archived":false,"fork":false,"pushed_at":"2024-06-15T14:52:44.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T18:07:29.048Z","etag":null,"topics":["golang","http","tor"],"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/sunaipa5.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}},"created_at":"2024-05-07T11:48:59.000Z","updated_at":"2024-06-15T14:52:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"55471871-1ec9-41cd-84bb-42482708ea46","html_url":"https://github.com/sunaipa5/reqtor","commit_stats":null,"previous_names":["sunaipa5/reqtor"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sunaipa5/reqtor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunaipa5%2Freqtor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunaipa5%2Freqtor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunaipa5%2Freqtor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunaipa5%2Freqtor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunaipa5","download_url":"https://codeload.github.com/sunaipa5/reqtor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunaipa5%2Freqtor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267494782,"owners_count":24096864,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","tor"],"created_at":"2024-12-02T14:25:46.081Z","updated_at":"2025-07-28T09:33:21.583Z","avatar_url":"https://github.com/sunaipa5.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Reqtor\n[![Go Reference](https://pkg.go.dev/badge/github.com/sunaipa5/reqtor.svg)](https://pkg.go.dev/github.com/sunaipa5/reqtor)\n\nGo library for sending http requests through Tor proxy or any proxy\n\n## Requirements\nIn order to use the Start, Stop Functions and AutoStart, AutoStop features, the `tor` cli tool must be added to the environment variables, the proxy is set to `socks5://127.0.0.1:9050` by default, you can change the proxy settings as you wish. \n\n## Examples\n### Sample Get Request\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/sunaipa5/reqtor\"\n)\n\n\nfunc main() {\n\terr := reqtor.Start()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\tresBody, err := reqtor.GetBody(\"https://example.com\", nil)\n\tif err != nil{\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\tfmt.Println(string(resBody))\n\n\terr = reqtor.Stop()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n}\n\n```\n### Send requests with headers and manually make get request\nNote : Headers also work with `GetBody` and `PostBody` Functions\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/sunaipa5/reqtor\"\n\t\"io\"\n)\n\nvar RequestHeaders = map[string]string{\n\t\"Accept\":          \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\",\n\t\"Accept-Charset\":  \"UTF-8,*;q=0.5\",\n\t\"Accept-Language\": \"en-US,en;q=0.8\",\n\t\"User-Agent\":      \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36\",\n}\n\nfunc main() {\n    err := reqtor.Start()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tresponse, err := reqtor.Get(\"https://example.com\", RequestHeaders)\n\tif err != nil{\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\tdefer response.Body.Close()\n\t\n\tresBody, err := io.ReadAll(response.Body)\n\tif err != nil{\n\t\tfmt.Println()\n\t\treturn\n\t}\n\t\n\tfmt.Println(string(resBody))\n\n    err = reqtor.Stop()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n}\n\n\n```\n### Change Settings\nIf you want `Tor` to turn off and on automatically every time you make a request, you should set AutoStar and AutoStop to `true`, by default they are `false`. If you want to make requests through a different proxy you can change the `ProxyProtocol`, `ProxyHost` and `ProxyPort` settings, the default values are socks5://127.0.0.1:9050\n```go\n    package main\n\n    import (\n        \"fmt\"\n        \"github.com/sunaipa5/reqtor\"\n    )\n\n\n    func main() {\n        reqtor.ProxyHost = \"socks5\"    //Default Protocol - socks5\n        reqtor.ProxyHost = \"127.0.0.1\" //Default Host - 127.0.0.1\n        reqtor.ProxyPort = 9050        //Default Port - 9050\n\n        reqtor.AutoStart = true //This setting starts automaticly tor cli tool before every request\n        reqtor.AutoStop = true  //This setting stops automaticly tor cli tool after every request\n\n        resBody, err := reqtor.GetBody(\"https://example.com\", nil)\n        if err != nil {\n            fmt.Println(err)\n            return\n        }\n        fmt.Println(string(resBody))\n    }\n\n```\n### Post Request\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/sunaipa5/reqtor\"\n)\n\nvar RequestHeaders = map[string]string{\n\t\"Accept\":          \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\",\n\t\"Accept-Charset\":  \"UTF-8,*;q=0.5\",\n\t\"Accept-Language\": \"en-US,en;q=0.8\",\n\t\"User-Agent\":      \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36\",\n\t\"Cookie\":          \"test_cookie=cookie_value; test_cookie2=cookie_value2\",\n}\n\nvar PostData = map[string]string{\n\t\"name\":     \"john\",\n\t\"surename\": \"doe\",\n\t\"age\":      \"24\",\n}\n\nfunc main() {\n\terr := reqtor.Start()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\t// If you are not sending RequestHeader or Post data, replace with nil\n\tresBody, err := reqtor.PostBody(\"https://example.com\", RequestHeaders, PostData)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\tfmt.Println(string(resBody))\n\n\terr = reqtor.Stop()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunaipa5%2Freqtor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunaipa5%2Freqtor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunaipa5%2Freqtor/lists"}