{"id":37529299,"url":"https://github.com/tobycroft/tuuznet","last_synced_at":"2026-04-09T04:01:18.155Z","repository":{"id":61628891,"uuid":"551329717","full_name":"tobycroft/TuuzNet","owner":"tobycroft","description":"TuuzNet is a Network package for http request curl and websocket, focus in high performance but simple use.","archived":false,"fork":false,"pushed_at":"2026-04-02T04:36:18.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-03T05:38:09.651Z","etag":null,"topics":["curl","golang","http","httpclient","httprequest","net","tuuznet","utils","websocket","websocket-client"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tobycroft.png","metadata":{"files":{"readme":"ReadME.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-10-14T07:45:58.000Z","updated_at":"2026-04-02T04:36:21.000Z","dependencies_parsed_at":"2025-04-20T05:34:38.368Z","dependency_job_id":"561cc413-835b-405e-8e23-2d86f70f3c7d","html_url":"https://github.com/tobycroft/TuuzNet","commit_stats":null,"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"purl":"pkg:github/tobycroft/TuuzNet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobycroft%2FTuuzNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobycroft%2FTuuzNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobycroft%2FTuuzNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobycroft%2FTuuzNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobycroft","download_url":"https://codeload.github.com/tobycroft/TuuzNet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobycroft%2FTuuzNet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31584816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"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":["curl","golang","http","httpclient","httprequest","net","tuuznet","utils","websocket","websocket-client"],"created_at":"2026-01-16T08:29:12.792Z","updated_at":"2026-04-09T04:01:18.149Z","avatar_url":"https://github.com/tobycroft.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TuuzNet-NetworkPackage\n\nTuuzNet is a full function simple but high performant http client\n\nFor more please visit project wiki\n\n- 能支持的功能(更多可以看wiki)\n    - Get\n        - InlineMode(Done by line)\n        - Builder Mode\n    - Post\n        - InlineMode(Done by line)\n        - Builder Mode\n    - Proxy\n        - socks5\n        - http\n    - Response In\n        - Byte\n        - Json\n        - String\n        - Cookie(Output)\n\n### What is TuuzNet?\n\nTuuzNet is a Network package for http request curl and websocket, focus in high performance but simple use.\n\n### Update Notice\n\nThere will be a huge difference between v1.0 and 1.1 DO NOT UPDATE, the opreration way is different!\n\nAfter v1.1 the version upgrades will be under compatible considered\n\n# Advantage\n\n- simple use 简单易用\n- High performance 高性能\n- Full function 全功能\n\n# How to use(v1.1.4+)\n\nInitial with\n\ngo get github.com/tobycroft/TuuzNet\n\n范例1，使用Websocket作为客户端链接到远程，这里以Shamrock（机器人）作为简单的Demo\n\n```go\nvar ws Net.WsClient\nws.NewConnect(\"ws://10.0.1.102:5801\")\n\nsend := Send{Action: \"send_private_msg\", Params: struct {\nUserId  int    `json:\"user_id\"`\nMessage string `json:\"message\"`\n}(struct {\nUserId  int\nMessage string\n}{UserId: 710209520, Message: \"test\"}), Echo: \"test\",\n}\nbt, _ := sonic.Marshal(send)\ngo func () {\ntime.Sleep(3 * time.Second)\nws.WriteChannel \u003c- bt\n}()\nfor {\nfmt.Println(string(\u003c-ws.ReadChannel))\n}\n```\n\n范例2，使用NetPost\n\nThe old version:\n\n```go\ndata, err: = Net.Post(botinfo[\"url\"].(string) + \"/get_group_info\", nil, post, nil, nil)\nif err != nil {\nreturn GroupInfo {}, err\n}\nvar ret1 GroupInfoRet\njsr: = jsoniter.ConfigCompatibleWithStandardLibrary\nerr = jsr.UnmarshalFromString(data, \u0026 ret1)\nif err != nil {\nreturn GroupInfo {}, err\n}\nif ret1.Retcode == 0 {\nreturn ret1.Data, nil\n} else {\nreturn GroupInfo {}, errors.New(ret1.Status)\n}\n```\n\nVer+ v1.1.4\n\nVer 1.11.0+ Support Builder Mode\n\n```go\nget := new(Net.PostBuilder).New()\nget.SetUrl(url_stats)\nget.SetHeader(map[string]string{\n\"user-agent\": \"your user agent\",\n\"ver\":        \"1.1.0\",\n\"platform\":   \"1\",\n})\n//if you need proxy then you can use this\nif proxy_on {\nauth := \u0026proxy.Auth{\nUser:     socks5_user_if_need,\nPassword: socks5_password_if_have,\n}\nif !need_auth {\nauth = nil\n}\nget.ProxySocks5(\"tcp\", \"127.0.0.1:10808\", auth)\n//if there is no auth needed \n//and you dont need to care about whether it will have in the future \n//you can directly use nil\n//get.ProxySocks5(\"tcp\", \"127.0.0.1:10808\", nil)\n}\nget.SetPostData(map[string]any{\n\"tags\":   \"\",\n\"system\": 28,\n\"lang\":   lang,\n})\nretbyte, err := get.PostUrlXEncode().RetBytes()\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobycroft%2Ftuuznet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobycroft%2Ftuuznet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobycroft%2Ftuuznet/lists"}