弈
弈方 YIFANG · THE ART OF PLAY
中文

Xiangqi · Play with friends

One player creates a room and sends the invitation link; the friend opens it, the host lets them in and the game starts. No account needed.

Two-player friend room

One player opens the room, the other joins. The host moves first.

Not connected

Host

Open a room

  1. Create a room to get an invitation link
  2. Send the link to your friend by any chat app
  3. Let your friend in when they open it — you move first

Guest

A friend invited me

  1. Open the host’s link — you join automatically
  2. Or paste the link below and choose Join room
  3. Play starts once connected — you move second
Connection notes and troubleshooting

Link mode: the PeerJS public service passes on the connection details; once connected, moves travel directly between the two players. If it never connects (for example the service is blocked on your network), switch to invitation + reply codes below.

Both players open the same game page over valid HTTPS. Localhost works only on this device; opening plain http on a LAN IP prevents the browser from keeping a recoverable match. The same Wi-Fi works best; cross-network connections are not guaranteed.

Invitation and reply codes may contain local network details. Share them only with friends you trust; they stop working when you leave the page.

After a refresh or disconnect: once connected, the moves, seats and a recovery credential are saved in this tab (sessionStorage). Keep both original tabs, choose Restore previous match and swap a fresh invitation and reply to continue. Closing the tab, clearing browsing data or switching devices prevents recovery; never share a save.

Only after you select this mode and create or join a room does it contact public PeerJS signaling. Its default configuration also tries third-party STUN and may relay match data through TURN. This is not fully service-free or guaranteed peer-to-peer transport. A room code is not a password; share it only with invited players. A distant friend must open the deployed site — your localhost link will not work for them.