The owner decided how a Server forwards. Forwarding spends the operator's bandwidth, so the operator offers it and it is off by default. Once offered, rooms use it without a second switch, a room manager can decline it, and the service ranks after participant paths (canon: P2P first, load is shared, the same rule for every node, automatic). a. Operator switches. PIIK_CHANNEL_SERVICE_TRANSIT is the master switch, off by default. PIIK_CHANNEL_SERVICE_TRANSIT_SCREEN, _VOICE and _FILES default to true and each turns one kind off. Files include original video forwarded for watching together. With the master switch off nothing is offered. The offer reaches room hosts with the service socket. The room removes the service from the relays of a kind it does not offer, and the channel rejects a projection that gives the service such a kind as site transit. A service that offers no kind reads as unavailable. b. A new room allows the service. Creation paths apply only an explicit choice, so Browser, App and Server-hosted rooms and room copies take the default, and a stored false stays false. The setting reads as declining a default, and its note says the site forwards only the kinds its operator offers, in all five locales. c. The planner names the service as the fallback. When a route is assigned it first extends the tree with participant relays only, then lets the service reach the receivers still waiting. It keeps that tree unless the joint tree, where the service may take a scarce output, serves more receivers, so ties go to participants. A strict participant-first pass could spend the source's outputs on direct listeners and leave those reachable only through the service unserved; a test reproduces that. The ranking among participants is unchanged. The rule applies when a route is assigned. A receiver already served through the service keeps that route until it fails or demand ends, even if a participant path appears later. A screen viewer can still make the usual move to a direct path from the person sharing. Left open: in a public room the service's session has ordinary read access, so a modified room host can list it as a plain participant relay, without the transit view that carries the room's choice and the operator's kinds, even when forwarding is off. Closing it needs the channel to recognise the Server's own session by identity in rooms that session does not host. Tests added in channel-core: a participant wins over the service; the service serves only receivers no participant path reaches; the service takes a scarce source output when that serves more receivers; a moved child takes a ready participant before the service; the service carries only the kinds its operator offers; a service that offers no kind reads as unavailable; a new room uses the offered service until its manager declines. Expectations changed for the new default in host_review, service_transit, stored_room and the first test of tests/service-transit-wasm.test.ts. Verified on the lane: cargo test for piik-channel-core with and without sqlite, cargo check for channel-server and channel-browser, the room_creation_policy test, a rebuilt WASM package, tsc -b, the whole vitest suite and the docs check. The channel-native suites were not run.
4.9 KiB
Use frp for a fixed Piik invitation address
English · 简体中文 · Documentation
Use frp to give a desktop Piik App or a privately hosted Piik Server a fixed public address. Set up the tunnel on the hosting side. Your friends open the room invitation in their browsers.
| Where it goes | What to enter |
|---|---|
| Local target in frp | The local IP and port of the Piik website. This guide uses 127.0.0.1:8787 with the tunnel client on the Piik machine. |
| Public address in Piik | The HTTPS hostname your friends can reach, including the assigned public port. Replace the example https://piik.example.nyat.app:21080 with yours. |
Get a public address
This example uses SakuraFrp (樱花映射). If you run frps or use another provider, forward the website and WebSocket traffic for the same public HTTPS address to Piik's local HTTP service, then continue to the Piik settings. Self-hosted frps setup
- Open the SakuraFrp launcher on the Piik machine. Sign in with the access key on the 用户信息 (User information) page of your SakuraFrp dashboard. Launcher walkthrough
- In 隧道列表 (Tunnels), create a TCP tunnel on a node that permits websites. Use
127.0.0.1and Piik's local web port. Leave the remote port empty for SakuraFrp to assign it and set 自动 HTTPS (Automatic HTTPS) to 自动 (Auto). Friends connect over HTTPS and Piik receives HTTP locally. Web tunnel settings · Automatic HTTPS - Under 子域绑定 (Subdomain binding), request a
nyat.appsubdomain. Select 新建绑定 (New binding) and choose your tunnel. Start or restart the tunnel. Once the log confirms it loaded the certificate for your subdomain, copy the hostname and public port from the log and prependhttps://. Subdomain and certificate walkthrough
Set the invitation address in Piik
Desktop App
- 3.0 beta. In the launcher choose Public invite → Existing address and enter your public HTTPS address. Match the tunnel's local target to the Local forwarding target shown in Piik, then enter Piik from the launcher. The host uses the page the App opens.
- 2.8 and later 2.x releases. Open PowerShell in the extracted App directory and run the command below. Replace the example HTTPS address with the public address from the tunnel log and replace the example port with the local port in the TCP tunnel settings. With v2.7.0, use the Server option below for a fixed address.
.\piik-app.exe --link --public-origin https://piik.example.nyat.app:21080 --port 8787
Existing Server
Apply the settings for your Server version to its existing configuration and restart the service. For a container deployment, point frp at the Piik web port published on the host.
| Version | Local web port | Public invitation address |
|---|---|---|
| 2.x Server | PORT=8787 |
PUBLIC_BASE_URL=https://piik.example.nyat.app:21080 |
| 3.0 Server | PIIK_CHANNEL_PORT=8787 |
PIIK_CHANNEL_INVITATION_ORIGIN=https://piik.example.nyat.app:21080 |
Enter the origin through the port. Piik adds the room path and any private invitation details when you copy the invitation.
Test from another network
Copy the full invitation from the room or show its QR code. Ask a friend to open it over cellular data. Entering the room and receiving a new chat message verifies the website and signaling path. Keep Piik and the tunnel running, start a share, then check picture and sound.
- The site fails to load or the certificate is untrusted. Check the invitation's hostname and public port. Look in the SakuraFrp log for a running tunnel and a certificate loaded for that subdomain. SakuraFrp troubleshooting
- Chat works but the picture will not connect. The web tunnel is working. Picture and sound use WebRTC. Try switching one device to a phone hotspot. Media network checks
Relay media through frp on a Server
Create a separate UDP tunnel and note the public IP and UDP port assigned by the provider. Keep the existing address for the web tunnel.
- 2.x Server. Set both the tunnel's local port and
SFU_UDP_PORTto its assigned public UDP port. SetSFU_PUBLIC_IPto the node's public IPv4 address. 2.x media forwarding settings - 3.0 Server. Forward the tunnel to
PIIK_CHANNEL_UDP_PORTand setPIIK_CHANNEL_UDP_PUBLIC_ADDRESSto the actual publicIP:port. EnablePIIK_CHANNEL_SERVICE_TRANSIT=trueon the Server; rooms then use site forwarding unless their owner turns it off in room settings.