{"id":26022447,"url":"https://github.com/NetrisTV/ws-scrcpy","last_synced_at":"2025-03-06T09:55:22.562Z","repository":{"id":39094545,"uuid":"190765263","full_name":"NetrisTV/ws-scrcpy","owner":"NetrisTV","description":"Web client prototype for scrcpy.","archived":false,"fork":false,"pushed_at":"2025-02-22T09:07:27.000Z","size":4148,"stargazers_count":1839,"open_issues_count":66,"forks_count":363,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-02-28T04:24:13.073Z","etag":null,"topics":["android","browser","control","javascript","mirroring","mobile","phone","remote","remote-control","scrcpy","screen","typescript","websocket"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/NetrisTV.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-07T15:16:37.000Z","updated_at":"2025-02-27T12:30:55.000Z","dependencies_parsed_at":"2023-02-18T10:30:44.991Z","dependency_job_id":"e773fd53-7647-4b27-8b93-76b0ae8b15a8","html_url":"https://github.com/NetrisTV/ws-scrcpy","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetrisTV%2Fws-scrcpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetrisTV%2Fws-scrcpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetrisTV%2Fws-scrcpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetrisTV%2Fws-scrcpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NetrisTV","download_url":"https://codeload.github.com/NetrisTV/ws-scrcpy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242187663,"owners_count":20086218,"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","browser","control","javascript","mirroring","mobile","phone","remote","remote-control","scrcpy","screen","typescript","websocket"],"created_at":"2025-03-06T09:55:21.362Z","updated_at":"2025-03-06T09:55:22.505Z","avatar_url":"https://github.com/NetrisTV.png","language":"TypeScript","readme":"# ws scrcpy\n\nWeb client for [Genymobile/scrcpy][scrcpy] and more.\n\n## Requirements\n\nBrowser must support the following technologies:\n* WebSockets\n* Media Source Extensions and h264 decoding;\n* WebWorkers\n* WebAssembly\n\nServer:\n* Node.js v10+\n* node-gyp ([installation](https://github.com/nodejs/node-gyp#installation))\n* `adb` executable must be available in the PATH environment variable\n\nDevice:\n* Android 5.0+ (API 21+)\n* Enabled [adb debugging](https://developer.android.com/studio/command-line/adb.html#Enabling)\n* On some devices, you also need to enable\n[an additional option](https://github.com/Genymobile/scrcpy/issues/70#issuecomment-373286323)\nto control it using keyboard and mouse.\n\n## Build and Start\n\nMake sure you have installed [node.js](https://nodejs.org/en/download/),\n[node-gyp](https://github.com/nodejs/node-gyp) and\n[build tools](https://github.com/nodejs/node-gyp#installation)\n```shell\ngit clone https://github.com/NetrisTV/ws-scrcpy.git\ncd ws-scrcpy\n\n## For stable version find latest tag and switch to it:\n# git tag -l\n# git checkout vX.Y.Z\n\nnpm install\nnpm start\n```\n\n## Supported features\n\n### Android\n\n#### Screen casting\nThe modified [version][fork] of [Genymobile/scrcpy][scrcpy] used to stream\nH264-video, which then decoded by one of included decoders:\n\n##### Mse Player\n\nBased on [xevokk/h264-converter][xevokk/h264-converter].\nHTML5 Video.\u003cbr\u003e\nRequires [Media Source API][MSE] and `video/mp4; codecs=\"avc1.42E01E\"`\n[support][isTypeSupported]. Creates mp4 containers from NALU, received from a\ndevice, then feeds them to [MediaSource][MediaSource]. In theory, it can use\nhardware acceleration.\n\n##### Broadway Player\n\nBased on [mbebenita/Broadway][broadway] and\n[131/h264-live-player][h264-live-player].\u003cbr\u003e\nSoftware video-decoder compiled into wasm-module.\nRequires [WebAssembly][wasm] and preferably [WebGL][webgl] support.\n\n##### TinyH264 Player\n\nBased on [udevbe/tinyh264][tinyh264].\u003cbr\u003e\nSoftware video-decoder compiled into wasm-module. A slightly updated version of\n[mbebenita/Broadway][broadway].\nRequires [WebAssembly][wasm], [WebWorkers][workers], [WebGL][webgl] support.\n\n##### WebCodecs Player\n\nDecoding is done by browser built-in (software/hardware) media decoder.\nRequires [WebCodecs][webcodecs] support. At the moment, available only in\n[Chromium](https://www.chromestatus.com/feature/5669293909868544) and derivatives.\n\n#### Remote control\n* Touch events (including multi-touch)\n* Multi-touch emulation: \u003ckbd\u003eCTRL\u003c/kbd\u003e to start with center at the center of\nthe screen, \u003ckbd\u003eSHIFT\u003c/kbd\u003e + \u003ckbd\u003eCTRL\u003c/kbd\u003e to start with center at the\ncurrent point\n* Mouse wheel and touchpad vertical/horizontal scrolling\n* Capturing keyboard events\n* Injecting text (ASCII only)\n* Copy to/from device clipboard\n* Device \"rotation\"\n\n#### File push\nDrag \u0026 drop an APK file to push it to the `/data/local/tmp` directory. You can\ninstall it manually from the included [xtermjs/xterm.js][xterm.js] terminal\nemulator (see below).\n\n#### Remote shell\nControl your device from `adb shell` in your browser.\n\n#### Debug WebPages/WebView\n[/docs/Devtools.md](/docs/Devtools.md)\n\n#### File listing\n* List files\n* Upload files by drag \u0026 drop\n* Download files\n\n### iOS\n\n***Experimental Feature***: *is not built by default*\n(see [custom build](#custom-build))\n\n#### Screen Casting\n\nRequires [ws-qvh][ws-qvh] available in `PATH`.\n\n#### MJPEG Server\n\nEnable `USE_WDA_MJPEG_SERVER` in the build configuration file\n(see [custom build](#custom-build)).\n\nAlternative way to stream screen content. It does not\nrequire additional software as `ws-qvh`, but may require more resources as each\nframe encoded as jpeg image.\n\n#### Remote control\n\nTo control device we use [appium/WebDriverAgent][WebDriverAgent].\nFunctionality limited to:\n* Simple touch\n* Scroll\n* Home button click\n\nMake sure you did properly [setup WebDriverAgent](https://appium.io/docs/en/drivers/ios-xcuitest-real-devices/).\nWebDriverAgent project is located under `node_modules/appium-webdriveragent/`.\n\nYou might want to enable `AssistiveTouch` on your device: `Settings/General/Accessibility`.\n\n## Custom Build\n\nYou can customize project before build by overriding the\n[default configuration](/webpack/default.build.config.json) in\n[build.config.override.json](/build.config.override.json):\n* `INCLUDE_APPL` - include code for iOS device tracking and control\n* `INCLUDE_GOOG` - include code for Android device tracking and control\n* `INCLUDE_ADB_SHELL` - [remote shell](#remote-shell) for android devices\n([xtermjs/xterm.js][xterm.js], [Tyriar/node-pty][node-pty])\n* `INCLUDE_DEV_TOOLS` - [dev tools](#debug-webpageswebview) for web pages and\nweb views on android devices\n* `INCLUDE_FILE_LISTING` - minimalistic [file management](#file-listing)\n* `USE_BROADWAY` - include [Broadway Player](#broadway-player)\n* `USE_H264_CONVERTER` - include [Mse Player](#mse-player)\n* `USE_TINY_H264` - include [TinyH264 Player](#tinyh264-player)\n* `USE_WEBCODECS` - include [WebCodecs Player](#webcodecs-player)\n* `USE_WDA_MJPEG_SERVER` - configure WebDriverAgent to start MJPEG server\n* `USE_QVH_SERVER` - include support for [ws-qvh][ws-qvh]\n* `SCRCPY_LISTENS_ON_ALL_INTERFACES` - WebSocket server in `scrcpy-server.jar`\nwill listen for connections on all available interfaces. When `true`, it allows\nconnecting to device directly from a browser. Otherwise, the connection must be\nestablished over adb.\n\n## Run configuration\n\nYou can specify a path to a configuration file in `WS_SCRCPY_CONFIG`\nenvironment variable.\n\nIf you want to have another pathname than \"/\" you can specify it in the\n`WS_SCRCPY_PATHNAME` environment variable.\n\nConfiguration file format: [Configuration.d.ts](/src/types/Configuration.d.ts).\n\nConfiguration file example: [config.example.yaml](/config.example.yaml).\n\n## Known issues\n\n* The server on the Android Emulator listens on the internal interface and not\navailable from the outside. Select `proxy over adb` from the interfaces list.\n* TinyH264Player may fail to start, try to reload the page.\n* MsePlayer reports too many dropped frames in quality statistics: needs\nfurther investigation.\n* On Safari file upload does not show progress (it works in one piece).\n\n## Security warning\nBe advised and keep in mind:\n* There is no encryption between browser and node.js server (you can [configure](#run-configuration) HTTPS).\n* There is no encryption between browser and WebSocket server on android device.\n* There is no authorization on any level.\n* The modified version of scrcpy with integrated WebSocket server is listening\nfor connections on all network interfaces (see [custom build](#custom-build)).\n* The modified version of scrcpy will keep running after the last client\ndisconnected.\n\n## Related projects\n* [Genymobile/scrcpy][scrcpy]\n* [xevokk/h264-converter][xevokk/h264-converter]\n* [131/h264-live-player][h264-live-player]\n* [mbebenita/Broadway][broadway]\n* [DeviceFarmer/adbkit][adbkit]\n* [xtermjs/xterm.js][xterm.js]\n* [udevbe/tinyh264][tinyh264]\n* [danielpaulus/quicktime_video_hack][qvh]\n\n## scrcpy websocket fork\n\nCurrently, support of WebSocket protocol added to v1.19 of scrcpy\n* [Prebuilt package](/vendor/Genymobile/scrcpy/scrcpy-server.jar)\n* [Source code][fork]\n\n[fork]: https://github.com/NetrisTV/scrcpy/tree/feature/websocket-v1.19.x\n\n[scrcpy]: https://github.com/Genymobile/scrcpy\n[xevokk/h264-converter]: https://github.com/xevokk/h264-converter\n[h264-live-player]: https://github.com/131/h264-live-player\n[broadway]: https://github.com/mbebenita/Broadway\n[adbkit]: https://github.com/DeviceFarmer/adbkit\n[xterm.js]: https://github.com/xtermjs/xterm.js\n[tinyh264]: https://github.com/udevbe/tinyh264\n[node-pty]: https://github.com/Tyriar/node-pty\n[WebDriverAgent]: https://github.com/appium/WebDriverAgent\n[qvh]: https://github.com/danielpaulus/quicktime_video_hack\n[ws-qvh]: https://github.com/NetrisTV/ws-qvh\n\n[MSE]: https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API\n[isTypeSupported]: https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/isTypeSupported\n[MediaSource]: https://developer.mozilla.org/en-US/docs/Web/API/MediaSource\n[wasm]: https://developer.mozilla.org/en-US/docs/WebAssembly\n[webgl]: https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API\n[workers]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API\n[webcodecs]: https://w3c.github.io/webcodecs/\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNetrisTV%2Fws-scrcpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNetrisTV%2Fws-scrcpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNetrisTV%2Fws-scrcpy/lists"}