{"id":13564261,"url":"https://github.com/koding/websocketproxy","last_synced_at":"2025-05-14T16:13:12.406Z","repository":{"id":39753872,"uuid":"20549909","full_name":"koding/websocketproxy","owner":"koding","description":"WebSocket reverse proxy handler for Go","archived":false,"fork":false,"pushed_at":"2023-08-16T07:18:00.000Z","size":30,"stargazers_count":432,"open_issues_count":22,"forks_count":121,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-05T19:07:50.950Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://godoc.org/github.com/koding/websocketproxy","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/koding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-06-06T03:15:26.000Z","updated_at":"2025-03-11T08:16:48.000Z","dependencies_parsed_at":"2024-01-07T22:48:38.324Z","dependency_job_id":"1d8a68da-d5ee-4f00-8367-6fb455c6312b","html_url":"https://github.com/koding/websocketproxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koding%2Fwebsocketproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koding%2Fwebsocketproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koding%2Fwebsocketproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koding%2Fwebsocketproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koding","download_url":"https://codeload.github.com/koding/websocketproxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631670,"owners_count":21136554,"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":[],"created_at":"2024-08-01T13:01:28.893Z","updated_at":"2025-04-12T20:39:25.382Z","avatar_url":"https://github.com/koding.png","language":"Go","funding_links":[],"categories":["Go","\u003ca id=\"01e6651181d405ecdcd92a452989e7e0\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"e9f97504fbd14c8bb4154bd0680e9e62\"\u003e\u003c/a\u003e反向代理"],"readme":"# WebsocketProxy [![GoDoc](https://godoc.org/github.com/koding/websocketproxy?status.svg)](https://godoc.org/github.com/koding/websocketproxy) [![Build Status](https://travis-ci.org/koding/websocketproxy.svg)](https://travis-ci.org/koding/websocketproxy)\n\nWebsocketProxy is an http.Handler interface build on top of\n[gorilla/websocket](https://github.com/gorilla/websocket) that you can plug\ninto your existing Go webserver to provide WebSocket reverse proxy.\n\n## Install\n\n```bash\ngo get github.com/koding/websocketproxy\n```\n\n## Example\n\nBelow is a simple server that proxies to the given backend URL\n\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"net/http\"\n\t\"net/url\"\n\n\t\"github.com/koding/websocketproxy\"\n)\n\nvar (\n\tflagBackend = flag.String(\"backend\", \"\", \"Backend URL for proxying\")\n)\n\nfunc main() {\n\tu, err := url.Parse(*flagBackend)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\terr = http.ListenAndServe(\":80\", websocketproxy.NewProxy(u))\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n}\n```\n\nSave it as `proxy.go` and run as:\n\n```bash\ngo run proxy.go -backend ws://example.com:3000\n```\n\nNow all incoming WebSocket requests coming to this server will be proxied to\n`ws://example.com:3000`\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoding%2Fwebsocketproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoding%2Fwebsocketproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoding%2Fwebsocketproxy/lists"}