{"id":15063306,"url":"https://github.com/tmc/grpc-websocket-proxy","last_synced_at":"2025-05-14T15:04:16.155Z","repository":{"id":38009012,"uuid":"63188538","full_name":"tmc/grpc-websocket-proxy","owner":"tmc","description":"A proxy to transparently upgrade grpc-gateway streaming endpoints to use websockets","archived":false,"fork":false,"pushed_at":"2023-07-04T09:05:19.000Z","size":59,"stargazers_count":556,"open_issues_count":17,"forks_count":72,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-10-29T15:47:51.359Z","etag":null,"topics":["grpc","grpc-gateway","proxy","websocket"],"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/tmc.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":"2016-07-12T19:59:39.000Z","updated_at":"2024-10-20T09:42:42.000Z","dependencies_parsed_at":"2024-06-18T11:22:55.831Z","dependency_job_id":"31916b98-e47a-45ea-ab0e-015ab6b22c16","html_url":"https://github.com/tmc/grpc-websocket-proxy","commit_stats":{"total_commits":27,"total_committers":9,"mean_commits":3.0,"dds":0.4814814814814815,"last_synced_commit":"673ab2c3ae75cc01952b84b88590e30e75dcf395"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmc%2Fgrpc-websocket-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmc%2Fgrpc-websocket-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmc%2Fgrpc-websocket-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmc%2Fgrpc-websocket-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmc","download_url":"https://codeload.github.com/tmc/grpc-websocket-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248384671,"owners_count":21094753,"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":["grpc","grpc-gateway","proxy","websocket"],"created_at":"2024-09-24T23:54:48.405Z","updated_at":"2025-04-11T11:36:09.547Z","avatar_url":"https://github.com/tmc.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# grpc-websocket-proxy\n\n[![GoDoc](https://godoc.org/github.com/tmc/grpc-websocket-proxy/wsproxy?status.svg)](http://godoc.org/github.com/tmc/grpc-websocket-proxy/wsproxy)\n\nWrap your grpc-gateway mux with this helper to expose streaming endpoints over websockets.\n\nOn the wire this uses newline-delimited json encoding of the messages.\n\nUsage:\n```diff\n\tmux := runtime.NewServeMux()\n\topts := []grpc.DialOption{grpc.WithInsecure()}\n\tif err := echoserver.RegisterEchoServiceHandlerFromEndpoint(ctx, mux, *grpcAddr, opts); err != nil {\n\t\treturn err\n\t}\n-\thttp.ListenAndServe(*httpAddr, mux)\n+\thttp.ListenAndServe(*httpAddr, wsproxy.WebsocketProxy(mux))\n```\n\n\n# wsproxy\n    import \"github.com/tmc/grpc-websocket-proxy/wsproxy\"\n\nPackage wsproxy implements a websocket proxy for grpc-gateway backed services\n\n## Usage\n\n```go\nvar (\n\tMethodOverrideParam = \"method\"\n\tTokenCookieName     = \"token\"\n)\n```\n\n#### func  WebsocketProxy\n\n```go\nfunc WebsocketProxy(h http.Handler) http.HandlerFunc\n```\nWebsocketProxy attempts to expose the underlying handler as a bidi websocket\nstream with newline-delimited JSON as the content encoding.\n\nThe HTTP Authorization header is either populated from the\nSec-Websocket-Protocol field or by a cookie. The cookie name is specified by the\nTokenCookieName value.\n\nexample:\n\n    Sec-Websocket-Protocol: Bearer, foobar\n\nis converted to:\n\n    Authorization: Bearer foobar\n\nMethod can be overwritten with the MethodOverrideParam get parameter in the\nrequested URL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmc%2Fgrpc-websocket-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmc%2Fgrpc-websocket-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmc%2Fgrpc-websocket-proxy/lists"}