{"id":13496702,"url":"https://github.com/TradeWithIt/WebSocket","last_synced_at":"2025-03-28T19:30:50.902Z","repository":{"id":230668614,"uuid":"776602087","full_name":"TradeWithIt/WebSocket","owner":"TradeWithIt","description":"Swift WebSocket client. Works on any platform Linux, Windows, iOS, Android, WASI and more","archived":false,"fork":false,"pushed_at":"2024-07-22T09:17:59.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-10-31T12:40:36.568Z","etag":null,"topics":["android","ios","linux","macos","swift","wasi","wasm","websocket","windows"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/TradeWithIt.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-03-24T00:24:58.000Z","updated_at":"2024-07-23T07:08:14.000Z","dependencies_parsed_at":"2024-07-22T11:11:26.815Z","dependency_job_id":null,"html_url":"https://github.com/TradeWithIt/WebSocket","commit_stats":null,"previous_names":["tradewithit/websocket"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeWithIt%2FWebSocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeWithIt%2FWebSocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeWithIt%2FWebSocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeWithIt%2FWebSocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TradeWithIt","download_url":"https://codeload.github.com/TradeWithIt/WebSocket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246088385,"owners_count":20721677,"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":["android","ios","linux","macos","swift","wasi","wasm","websocket","windows"],"created_at":"2024-07-31T19:01:57.402Z","updated_at":"2025-03-28T19:30:50.642Z","avatar_url":"https://github.com/TradeWithIt.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# WebSocket\nWebSocket client for **Apple** platforms build on top of Foundation `URLSessionWebSocketTask`\n\n## Usage\n\nSet auth:\n```\nimport WebSocket\n\nlet websocket = WebSocket()\nlet request = URLRequest(url: URL(string: \"wss:my-url\")!)\n\ntry websocket.connect(to: request) { socket in\n    socket.onText { ws, text in\n        \n    }\n    socket.onData { ws, data in\n        \n    }\n    socket.onClose { ws in\n        \n    }\n}\n```\n\n## Installation\n\n### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the swift compiler.\n\nOnce you have your Swift package set up, adding a dependency is as easy as adding it to the dependencies value of your Package.swift.\n\nAdd the package dependency in your Package.swift:\n```\ndependencies: [\n    .package(url: \"https://github.com/TradeWithIt/WebSocket\", branch: \"main\")\n]\n```\nNext, in your target, add OpenAPIURLSession to your dependencies:\n```\n.target(name: \"MyTarget\", dependencies: [\n    .product(name: \"WebSocket\", package: \"WebSocket\"),\n]),\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTradeWithIt%2FWebSocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTradeWithIt%2FWebSocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTradeWithIt%2FWebSocket/lists"}