{"id":20829782,"url":"https://github.com/pdf/websocketrwc","last_synced_at":"2025-08-13T23:04:34.885Z","repository":{"id":136472884,"uuid":"80875771","full_name":"pdf/websocketrwc","owner":"pdf","description":"Golang package that wraps Gorilla websocket in an io.ReadWriteCloser interface","archived":false,"fork":false,"pushed_at":"2017-05-02T23:25:16.000Z","size":3,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T05:03:41.362Z","etag":null,"topics":["encoding","go","golang","golang-library","readwritecloser","websocket"],"latest_commit_sha":null,"homepage":null,"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/pdf.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}},"created_at":"2017-02-03T22:43:02.000Z","updated_at":"2024-09-26T17:02:09.000Z","dependencies_parsed_at":"2024-06-20T16:33:39.252Z","dependency_job_id":"2f577aec-3acf-43a6-b22b-46deeda2e9ce","html_url":"https://github.com/pdf/websocketrwc","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/pdf/websocketrwc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdf%2Fwebsocketrwc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdf%2Fwebsocketrwc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdf%2Fwebsocketrwc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdf%2Fwebsocketrwc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pdf","download_url":"https://codeload.github.com/pdf/websocketrwc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdf%2Fwebsocketrwc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270330595,"owners_count":24565816,"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-08-13T02:00:09.904Z","response_time":66,"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":["encoding","go","golang","golang-library","readwritecloser","websocket"],"created_at":"2024-11-17T23:22:05.265Z","updated_at":"2025-08-13T23:04:34.852Z","avatar_url":"https://github.com/pdf.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/github.com/pdf/websocketrwc?status.svg)](http://godoc.org/github.com/pdf/websocketrwc) ![License-MIT](http://img.shields.io/badge/license-MIT-red.svg)\n\n# websocketrwc\n--\n    import \"github.com/pdf/websocketrwc\"\n\nPackage websocketrwc wraps Gorilla websocket in an io.ReadWriteCloser compatible\ninterface, allowing it to be used as a net/rpc or similar connection. Only the\nserver side is currently implemented.\n\n## Usage\n\n```go\nvar (\n\t// ErrClosing is returned for operations during close phase.\n\tErrClosing = errors.New(`Closing`)\n\t// DefaultUpgrader will be used if a nil upgrader is passed to Upgrade().\n\tDefaultUpgrader = \u0026websocket.Upgrader{\n\t\tHandshakeTimeout:  defaultHandshakeTimeout,\n\t\tReadBufferSize:    defaultBufferSize,\n\t\tWriteBufferSize:   defaultBufferSize,\n\t\tEnableCompression: true,\n\t\tCheckOrigin:       func(r *http.Request) bool { return true },\n\t}\n\t// WriteTimeout determines the period of time a write will wait to complete\n\t// before producing an error.\n\tWriteTimeout = 10 * time.Second\n\t// PongTimeout determines the period of time a connection will wait for a\n\t// Pong response to Pings sent to the client.\n\tPongTimeout = 60 * time.Second\n\t// PingInterval determins the interval at which Pings are sent to the\n\t// client.\n\tPingInterval = (PongTimeout * 9) / 10\n)\n```\n\n#### type Conn\n\n```go\ntype Conn struct {\n}\n```\n\nConn wraps gorilla websocket to provide io.ReadWriteCloser.\n\n#### func  Upgrade\n\n```go\nfunc Upgrade(w http.ResponseWriter, r *http.Request, h http.Header, upgrader *websocket.Upgrader) (*Conn, error)\n```\nUpgrade a HTTP connection.\n\n#### func (*Conn) Close\n\n```go\nfunc (c *Conn) Close() error\n```\nClose implements io.Closer and closes the underlying connection.\n\n#### func (*Conn) Read\n\n```go\nfunc (c *Conn) Read(p []byte) (n int, err error)\n```\nRead implements io.Reader by wrapping websocket messages in a buffer.\n\n#### func (*Conn) Write\n\n```go\nfunc (c *Conn) Write(p []byte) (n int, err error)\n```\nWrite implements io.Writer and sends binary messages only.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdf%2Fwebsocketrwc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdf%2Fwebsocketrwc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdf%2Fwebsocketrwc/lists"}