百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

switch-lan-play

> 编程语言
开源

与朋友一起享受游戏,仿佛您在局域网上一样。

2.0K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

与朋友一起享受游戏,仿佛您在局域网上一样。

switch-lan-play

English | 中文

Enjoy games with your friends as if you were on a LAN.

                     Internet
                        |
                  [SOCKS5 Proxy] (optional)
                        |
        ARP,IPv4        |          LAN Packets
Switch <-------->  PC(lan-play)  <-------------> Server
                                       UDP

Usage

To 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.

Your PC and Switch must be connected to the same router.

Visit https://www.lan-play.com/ for instructions on how to set this up. See below for build instructions.

SOCKS5 Proxy

lan-play --socks5-server-addr example.com:1080

Data sent to the relay server does not pass through the proxy.

Build

Debug or Release

cmake -DCMAKE_BUILD_TYPE=Debug .. cmake -DCMAKE_BUILD_TYPE=Release ..

Ubuntu / Debian

This project depends on libpcap, you can install libpcap0.8-dev on Ubuntu or Debian:

sudo apt install libpcap0.8-dev git gcc g++ cmake

Prepare cmake and gcc, then run the following:

mkdir build
cd build
cmake ..
make

Windows

Use MSYS2 to compile.

pacman -Sy
pacman -S make \
    mingw-w64-x86_64-cmake \
    mingw-w64-x86_64-gcc

To compile a 32-bit program:

pacman -S mingw-w64-i686-cmake \
    mingw-w64-i686-gcc

Open MSYS2 MinGW 64-bit or MSYS2 MinGW 32-bit.

mkdir build
cd build
cmake -G "MSYS Makefiles" ..
make

Mac OS

brew install cmake
mkdir build
cd build
cmake ..
make

Server

Docker

docker run -d -p 11451:11451/udp -p 11451:11451/tcp spacemeowx2/switch-lan-play

Node

git clone https://github.com/spacemeowx2/switch-lan-play
cd switch-lan-play/server
npm install
npm run build # build ts to js. run it again when code changes.
npm start

Use --port to pass the port parameter, or it will use 11451/udp as the default.

Use --simpleAuth to pass authentication via username and password, or there will be no authentication.

Use --httpAuth to pass authentication via HTTP URL, or there will be no authentication.

Use --jsonAuth to pass authentication via JSON file, or there will be no authentication.

Example:

npm run build
npm start -- --port 10086 --simpleAuth username:password

Meanwhile, the monitor service will start on port 11451/tcp by default. You can get the online client count via an HTTP request:

Request: GET http://{YOUR_SERVER_IP}:11451/info

Response: { "online": 42 }

Protocol

The 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.

struct packet {
    uint8_t type;
    uint8_t payload[packet_len - 1];
};
enum type {
    KEEPALIVE = 0,
    IPV4 = 1,
    PING = 2,
    IPV4_FRAG = 3
};

The server can read IP addresses from the payload and save the source IP -> 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.

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •C
  • •lan-play
  • •libpcap
  • •nintendoswitch
  • •switch

> 标签

Clan-playlibpcapnintendoswitchswitch

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言