{"id":21668483,"url":"https://github.com/hummingbird-project/swift-websocket","last_synced_at":"2025-04-12T02:21:35.894Z","repository":{"id":262978154,"uuid":"887326901","full_name":"hummingbird-project/swift-websocket","owner":"hummingbird-project","description":"Support for WebSockets","archived":false,"fork":false,"pushed_at":"2025-04-05T15:38:17.000Z","size":107,"stargazers_count":56,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-05T16:24:21.395Z","etag":null,"topics":["server-side-swift","swift","websocket-client","websockets"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hummingbird-project.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"adam-fowler"}},"created_at":"2024-11-12T14:54:18.000Z","updated_at":"2025-04-05T15:38:18.000Z","dependencies_parsed_at":"2024-12-04T08:22:54.232Z","dependency_job_id":"26248255-aeaa-495c-a1f0-d4ffc7399742","html_url":"https://github.com/hummingbird-project/swift-websocket","commit_stats":null,"previous_names":["hummingbird-project/swift-websocket"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hummingbird-project%2Fswift-websocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hummingbird-project%2Fswift-websocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hummingbird-project%2Fswift-websocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hummingbird-project%2Fswift-websocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hummingbird-project","download_url":"https://codeload.github.com/hummingbird-project/swift-websocket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505921,"owners_count":21115354,"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":["server-side-swift","swift","websocket-client","websockets"],"created_at":"2024-11-25T12:16:03.912Z","updated_at":"2025-04-12T02:21:35.882Z","avatar_url":"https://github.com/hummingbird-project.png","language":"Swift","funding_links":["https://github.com/sponsors/adam-fowler"],"categories":[],"sub_categories":[],"readme":"## swift-websocket\n\nSupport for WebSockets\n\n### Overview\n\nPackage containing support for WebSockets. It contains three libraries\n- WSCore: Core WebSocket handler (can be used by both server and client)\n- WSClient: WebSocket client\n- WSCompression: WebSocket compression support\n\n### Client\n\nThe WebSocketClient is built on top of structured concurrency. When you connect it calls the closure you provide with an inbound stream of frames, a writer to write outbound frames and a context structure. When you exit the closure the client will automatically perform the close handshake for you. \n\n```swift\nimport WSClient\n\nlet ws = WebSocketClient.connect(url: \"ws://mywebsocket.com/ws\") { inbound, outbound, context in\n    try await outbound.write(.text(\"Hello\"))\n    // you can convert the inbound stream of frames into a stream of full messages using `messages(maxSize:)`\n    for try await frame in inbound.messages(maxSize: 1 \u003c\u003c 14) {\n        context.logger.info(frame)\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhummingbird-project%2Fswift-websocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhummingbird-project%2Fswift-websocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhummingbird-project%2Fswift-websocket/lists"}