{"id":30142148,"url":"https://github.com/local-connectivity-lab/lcl-websocket","last_synced_at":"2025-08-11T05:41:34.924Z","repository":{"id":272214875,"uuid":"854003986","full_name":"Local-Connectivity-Lab/lcl-websocket","owner":"Local-Connectivity-Lab","description":"LCL WebSocket is a cross-platform WebSocket library written in Swift and for Swift, built on top of SwiftNIO.","archived":false,"fork":false,"pushed_at":"2025-02-23T08:11:06.000Z","size":152,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-03T16:41:18.844Z","etag":null,"topics":["asynchronous","swift","swiftnio","websocket","websocket-client","websocket-server"],"latest_commit_sha":null,"homepage":"https://swiftpackageindex.com/Local-Connectivity-Lab/lcl-websocket/documentation","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/Local-Connectivity-Lab.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":"2024-09-08T06:14:42.000Z","updated_at":"2025-06-27T20:33:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"1fd2e3ad-8295-477b-a5cb-38b1d4342148","html_url":"https://github.com/Local-Connectivity-Lab/lcl-websocket","commit_stats":null,"previous_names":["local-connectivity-lab/lcl-websocket"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Local-Connectivity-Lab/lcl-websocket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Local-Connectivity-Lab%2Flcl-websocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Local-Connectivity-Lab%2Flcl-websocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Local-Connectivity-Lab%2Flcl-websocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Local-Connectivity-Lab%2Flcl-websocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Local-Connectivity-Lab","download_url":"https://codeload.github.com/Local-Connectivity-Lab/lcl-websocket/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Local-Connectivity-Lab%2Flcl-websocket/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269837922,"owners_count":24483181,"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-11T02:00:10.019Z","response_time":75,"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":["asynchronous","swift","swiftnio","websocket","websocket-client","websocket-server"],"created_at":"2025-08-11T05:41:32.646Z","updated_at":"2025-08-11T05:41:34.909Z","avatar_url":"https://github.com/Local-Connectivity-Lab.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LCL WebSocket\n\nLCL WebSocket is a cross-platform WebSocket [[RFC 6455]](https://datatracker.ietf.org/doc/html/rfc6455) library written in Swift and for Swift, built on top of SwiftNIO.\n\n\n\n## Features\n\n- Conform to all [AutoBahn](https://github.com/crossbario/autobahn-testsuite) cases\n- High-performance WebSocket client and server, on top of SwiftNIO\n- TLS/SSL support\n- Thread-safe\n- Cross-platform\n- Customizable configurations\n- Comprehensive error handling\n- Support WebSocket per-message deflate extension (RFC 7692)\n\n## Requirements\n- Swift 5.9+\n- macOS 10.15+, iOS 13+, Linux\n\n## Getting Started\n\n### Swift Package Manager\n\nAdd the following to your `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/Local-Connectivity-Lab/lcl-websocket.git\", from: \"1.0.0\")\n]\n```\n\n### Basic Usage\n\n**Client**\n```swift\nlet config = LCLWebSocket.Configuration(\n    maxFrameSize: 1 \u003c\u003c 16,\n    autoPingConfiguration: .enabled(pingInterval: .seconds(4), pingTimeout: .seconds(10)),\n    leftoverBytesStrategy: .forwardBytes\n)\n\n// Initialize the client\nvar client = LCLWebSocket.client()\nclient.onOpen { websocket in\n    websocket.send(.init(string: \"hello\"), opcode: .text, promise: nil)\n}\n\nclient.onBinary { websocket, binary in\n    print(\"received binary: \\(binary)\")\n}\n\nclient.onText { websocket, text in\n    print(\"received text: \\(text)\")\n}\n\ntry client.connect(to: \"ws://127.0.0.1:8080\", configuration: config).wait()\n```\n\n**Server**\n```swift\nlet config = LCLWebSocket.Configuration(\n    maxFrameSize: 1 \u003c\u003c 16,\n    autoPingConfiguration: .disabled,\n    leftoverBytesStrategy: .forwardBytes\n)\n\nserver.onPing { websocket, buffer in\n    print(\"onPing: \\(buffer)\")\n    websocket.pong(data: buffer)\n}\nserver.onPong { ws, buffer in\n    print(\"onPong: \\(buffer)\")\n}\nserver.onBinary { websocket, buffer in\n    websocket.send(buffer, opcode: .binary, promise: nil)\n}\nserver.onText { websocket, text in\n    print(\"received text: \\(text)\")\n    websocket.send(.init(string: text), opcode: .text, promise: nil)\n}\nserver.onClosing { code, reason in\n    print(\"on closing: \\(String(describing: code)), \\(String(describing: reason))\")\n}\n\n// wait forever\ntry server.listen(host: \"127.0.0.1\", port: 8080, configuration: config).wait()\n```\n\n\n## TODO\n- [x] Support WebSocket Compression Extension\n- [ ] Support Swift Concurrency\n\n\n## Contributing\nAny contribution and pull requests are welcome! However, before you plan to implement some features or try to fix an uncertain issue, it is recommended to open a discussion first. You can also join our [Discord channel](https://discord.com/invite/gn4DKF83bP), or visit our [website](https://seattlecommunitynetwork.org/).\n\n## License\nlcl-websocket is released under Apache License. See [LICENSE](/LICENSE) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocal-connectivity-lab%2Flcl-websocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocal-connectivity-lab%2Flcl-websocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocal-connectivity-lab%2Flcl-websocket/lists"}