{"id":13605518,"url":"https://github.com/spacemeowx2/switch-lan-play","last_synced_at":"2025-05-14T04:10:00.867Z","repository":{"id":37451048,"uuid":"113214875","full_name":"spacemeowx2/switch-lan-play","owner":"spacemeowx2","description":"Enjoy games with your friends as if you were on a LAN.","archived":false,"fork":false,"pushed_at":"2025-03-21T04:12:05.000Z","size":3428,"stargazers_count":1857,"open_issues_count":59,"forks_count":192,"subscribers_count":46,"default_branch":"master","last_synced_at":"2025-04-14T06:48:12.952Z","etag":null,"topics":["lan-play","libpcap","nintendoswitch","switch"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spacemeowx2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2017-12-05T17:52:15.000Z","updated_at":"2025-04-13T10:12:18.000Z","dependencies_parsed_at":"2022-07-09T09:30:22.314Z","dependency_job_id":"f35482b0-a005-4577-bc12-df65f532aade","html_url":"https://github.com/spacemeowx2/switch-lan-play","commit_stats":{"total_commits":285,"total_committers":15,"mean_commits":19.0,"dds":0.08070175438596494,"last_synced_commit":"5f48da2a7dfeed38c8c35ccc8daa903c25d4ffaa"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacemeowx2%2Fswitch-lan-play","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacemeowx2%2Fswitch-lan-play/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacemeowx2%2Fswitch-lan-play/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacemeowx2%2Fswitch-lan-play/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spacemeowx2","download_url":"https://codeload.github.com/spacemeowx2/switch-lan-play/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254070109,"owners_count":22009559,"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":["lan-play","libpcap","nintendoswitch","switch"],"created_at":"2024-08-01T19:00:59.676Z","updated_at":"2025-05-14T04:09:55.843Z","avatar_url":"https://github.com/spacemeowx2.png","language":"C","funding_links":[],"categories":["C","others","🔧 Packages"],"sub_categories":["⚡ Misc"],"readme":"# switch-lan-play\n[![Build status](https://github.com/spacemeowx2/switch-lan-play/workflows/Build/badge.svg)](https://github.com/spacemeowx2/switch-lan-play/actions?query=workflow%3ABuild)\n[![Chat on discord](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/zEMCu5n)\n\nEnglish | [中文](README_zh.md)\n\nEnjoy games with your friends as if you were on a LAN.\n\n```\n                     Internet\n                        |\n                  [SOCKS5 Proxy] (optional)\n                        |\n        ARP,IPv4        |          LAN Packets\nSwitch \u003c--------\u003e  PC(lan-play)  \u003c-------------\u003e Server\n                                       UDP\n```\n\n# Usage\n\nTo play with your friends, both you and your friends need to run the lan-play client connecting to the **same** Server on your PCs, and set static IP on your Switch.\n\nYour PC and Switch **must** be connected to the same router.\n\nVisit [https://www.lan-play.com/](http://lan-play.com/install-switch) for instructions on how to set this up. See below for build instructions.\n\n## SOCKS5 Proxy\n\nlan-play --socks5-server-addr example.com:1080\n\nData sent to the relay server does not pass through the proxy.\n\n# Build\n\n## Debug or Release\n\n`cmake -DCMAKE_BUILD_TYPE=Debug ..`\n`cmake -DCMAKE_BUILD_TYPE=Release ..`\n\n## Ubuntu / Debian\n\nThis project depends on libpcap, you can install libpcap0.8-dev on Ubuntu or Debian:\n\n`sudo apt install libpcap0.8-dev git gcc g++ cmake`\n\nPrepare cmake and gcc, then run the following:\n\n```sh\nmkdir build\ncd build\ncmake ..\nmake\n```\n\n## Windows\n\nUse [MSYS2](http://www.msys2.org/) to compile.\n\n```sh\npacman -Sy\npacman -S make \\\n    mingw-w64-x86_64-cmake \\\n    mingw-w64-x86_64-gcc\n```\n\nTo compile a 32-bit program:\n\n```sh\npacman -S mingw-w64-i686-cmake \\\n    mingw-w64-i686-gcc\n```\n\nOpen `MSYS2 MinGW 64-bit` or `MSYS2 MinGW 32-bit`.\n\n```sh\nmkdir build\ncd build\ncmake -G \"MSYS Makefiles\" ..\nmake\n```\n\n## Mac OS\n\n```sh\nbrew install cmake\n```\n\n```sh\nmkdir build\ncd build\ncmake ..\nmake\n```\n\n# Server\n\n## Docker\n\n`docker run -d -p 11451:11451/udp -p 11451:11451/tcp spacemeowx2/switch-lan-play`\n\n## Node\n\n```sh\ngit clone https://github.com/spacemeowx2/switch-lan-play\ncd switch-lan-play/server\nnpm install\nnpm run build # build ts to js. run it again when code changes.\nnpm start\n```\n\nUse `--port` to pass the port parameter, or it will use `11451/udp` as the default.\n\nUse `--simpleAuth` to pass authentication via username and password, or there will be no authentication.\n\nUse `--httpAuth` to pass authentication via HTTP URL, or there will be no authentication.\n\nUse `--jsonAuth` to pass authentication via JSON file, or there will be no authentication.\n\nExample:\n\n```sh\nnpm run build\nnpm start -- --port 10086 --simpleAuth username:password\n```\n\nMeanwhile, the monitor service will start on port `11451/tcp` by default. You can get the online client count via an HTTP request:\n\nRequest: `GET http://{YOUR_SERVER_IP}:11451/info`\n\nResponse: `{ \"online\": 42 }`\n\n\n# Protocol\n\nThe protocol is quite simple at the moment, but additional fields may be added to calculate network quality (packet loss, ping), such as timestamp, seq_id, etc.\n\n```c\nstruct packet {\n    uint8_t type;\n    uint8_t payload[packet_len - 1];\n};\n```\n\n```c\nenum type {\n    KEEPALIVE = 0,\n    IPV4 = 1,\n    PING = 2,\n    IPV4_FRAG = 3\n};\n```\n\nThe server can read IP addresses from the payload and save the source IP -\u003e LAN IP to a cache table. If the target IP address shown in the payload doesn't match the cache, the packet is broadcast to the entire room.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspacemeowx2%2Fswitch-lan-play","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspacemeowx2%2Fswitch-lan-play","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspacemeowx2%2Fswitch-lan-play/lists"}