{"id":1826,"url":"https://github.com/fjcaetano/RxWebSocket","last_synced_at":"2025-08-06T14:31:25.068Z","repository":{"id":3576884,"uuid":"50203606","full_name":"fjcaetano/RxWebSocket","owner":"fjcaetano","description":"Reactive WebSockets","archived":true,"fork":false,"pushed_at":"2022-10-05T22:52:44.000Z","size":469,"stargazers_count":55,"open_issues_count":9,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-12-05T00:46:21.921Z","etag":null,"topics":["ios","macos","reactive-programming","rxswift","starscream","swift","tvos","watchos","websockets"],"latest_commit_sha":null,"homepage":"http://blog.flaviocaetano.com/post/rxwebsocket/","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/fjcaetano.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-22T19:42:25.000Z","updated_at":"2024-03-04T04:10:45.000Z","dependencies_parsed_at":"2022-08-09T09:30:20.359Z","dependency_job_id":null,"html_url":"https://github.com/fjcaetano/RxWebSocket","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjcaetano%2FRxWebSocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjcaetano%2FRxWebSocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjcaetano%2FRxWebSocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjcaetano%2FRxWebSocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fjcaetano","download_url":"https://codeload.github.com/fjcaetano/RxWebSocket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228905550,"owners_count":17989782,"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":["ios","macos","reactive-programming","rxswift","starscream","swift","tvos","watchos","websockets"],"created_at":"2024-01-05T20:15:56.725Z","updated_at":"2024-12-09T14:31:17.330Z","avatar_url":"https://github.com/fjcaetano.png","language":"Swift","readme":"# RxWebSocket\n\n[![Build Status](https://travis-ci.org/fjcaetano/RxWebSocket.svg?branch=master)](https://travis-ci.org/fjcaetano/RxWebSocket)\n[![codecov](https://codecov.io/gh/fjcaetano/RxWebSocket/branch/master/graph/badge.svg)](https://codecov.io/gh/fjcaetano/RxWebSocket)\n[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/fjcaetano/ReCaptcha/pulls)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-orange.svg)](https://github.com/Carthage/Carthage)\n[![SPM compatible](https://img.shields.io/badge/SPM-compatible-orange.svg)](https://github.com/Carthage/Carthage)\n[![Version](https://img.shields.io/cocoapods/v/RxWebSocket.svg?style=flat)](http://cocoapods.org/pods/RxWebSocket)\n[![License](https://img.shields.io/cocoapods/l/RxWebSocket.svg?style=flat)](http://cocoapods.org/pods/RxWebSocket)\n[![Platform](https://img.shields.io/cocoapods/p/RxWebSocket.svg?style=flat)](http://cocoapods.org/pods/RxWebSocket)\n\n---\n\nReactive extensions for websockets.\n\nA lightweight abstraction layer over [Starscream](https://github.com/daltoniam/Starscream) to make it reactive.\n\n## Installation\n\nRxWebSocket is available through [CocoaPods](http://cocoapods.org) and\n[Carthage](https://github.com/Carthage/Carthage). To install it, simply add the\nfollowing line to your depedencies file:\n\n#### Cocoapods\n\n```ruby\npod \"RxWebSocket\"\n```\n\n#### Carthage\n\n```ruby\ngithub \"fjcaetano/RxWebSocket\"\n```\n\n## Usage\n\nEvery websocket event will be sent to the `stream` which is an `Observable\u003cStreamEvent\u003e`.\n\n```swift\n  public enum StreamEvent {\n    case connect\n    case disconnect(Error?)\n    case pong\n    case text(String)\n    case data(Data)\n  }\n```\n\nYou may receive and send text events by subscribing to the `text` property:\n\n```swift\nlet label = UILabel()\nsocket.rx.text\n    .bind(to: label.rx.text)\n\n\nsendButton.rx.tap\n    .flatMap { textField.text ?? \"\" }\n    .bind(to: socket.rx.text)\n```\n\nFor further details, check the Example project.\n\n## Contributing\n\nAfter cloning the project, pull all submodules with\n\n```sh\ngit submodule update --init --recursive\n```\n\n### Requirements\n\nRxWebSocket relies on the following for development:\n\n- [Python 3.6](https://www.python.org/download/releases/3.0/)\n- [Fastlane](https://github.com/fastlane/fastlane)\n- [Python Websockets](https://github.com/aaugustin/websockets)\n- [Swiftlint](https://github.com/realm/SwiftLint)\n\nTo install all dependencies without hassles just run:\n\n```sh\n./install_dependencies.sh\n```\n\nWhich will install all the dependencies and virtual envs if necessary.\n\n### Running Tests\n\nXcode and Fastlane will take care of starting and stopping websocket echoservers\nfor testing, however if you find that tests are timing out, this is usually a\nsign that the server is not running. If so, you can manage it running\n\n```sh\n./server.sh {start|stop|restart|status}\n```\n\nThis will tell wstests to launch an echo server on 127.0.0.1:9000. If this port\nis unusable for you by any reason, you may change it in the `server.sh` file.\n\n### Upgrading to a new Swift version\n\nUpgrading a new Swift version requires upgrading the dependencies as well. Since the RxWebSocket is\ndistributed through Cocoapods, Carthage and Swift Package Manager, the dependencies must be upgraded\nin the corresponding spec file for the three platforms:\n\n#### Cocoapods\n\nIn RxWebSocket.podspec, update `swift_version` and the dependencies' versions at the end of the file\n\n#### Carthage\n\nUpgrade the dependencies' versions in `Cartfile`\n\n#### Swift Package Manager\n\nUpgrade the dependencies' versions in `Package.swift`\n\n### Housekeeping\n\nBefore commiting, make sure to run, at least, the `test` lane on Fastlane. This will run all iOS\ntests.\n\nIf you want to be thorough, which is recommended and appreciated, run the `ci` lane, which is the\nsame lane Travis runs when testing PRs. This lane will run tests for iOS, tvOS and macOS, as well as\nlint the project for the three package managers. If this lane passes, you can be 100% sure everything\nis running as smoothly as possible.\n\n## Help Wanted\n\nDo you love RxWebsocket and work actively on apps that use it? We'd love if you could help us keep improving it!\nFeel free to message us or to start contributing right away!\n\n## License\n\nRxWebSocket is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":["Libs","Reactive Programming","Swift","Network [🔝](#readme)"],"sub_categories":["Network","Other free courses","Prototyping","Other Parsing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffjcaetano%2FRxWebSocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffjcaetano%2FRxWebSocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffjcaetano%2FRxWebSocket/lists"}