What is Realm
About Realm
Realm is a lightweight port-forwarding tool supporting TCP/UDP. It can forward local traffic to WarpTok entry addresses for flexible network architectures.
Use cases
- Manage multiple forwarding rules on a local server
- Preprocess or monitor traffic
- Deploy forwarding nodes inside a private network
- Customize forwarding logic
Install Realm
Linux
# Download the latest release
wget https://github.com/zhboner/realm/releases/download/v2.5.4/realm-x86_64-unknown-linux-gnu.tar.gz
# Extract
tar -xzf realm-x86_64-unknown-linux-gnu.tar.gz
# Move to PATH
sudo mv realm /usr/local/bin/
# Verify
realm --versionWindows
- Open the GitHub Releases page
- Download realm-x86_64-pc-windows-msvc.zip
- Extract to a folder (e.g. C:\realm)
- Add the folder to your PATH
- Open Command Prompt and run realm --version
macOS
# Install via Homebrew
brew install realm
# Or download manually
wget https://github.com/zhboner/realm/releases/download/v2.5.4/realm-x86_64-apple-darwin.tar.gz
tar -xzf realm-x86_64-apple-darwin.tar.gz
sudo mv realm /usr/local/bin/Basic configuration
Create a config file
Create a realm config file config.toml
# config.toml
[network]
no_tcp = false
use_udp = true
[[endpoints]]
listen = "0.0.0.0:8080"
remote = "203.0.113.45:1935"
# listen: local bind address and port
# remote: WarpTok entry IP and portConfiguration notes
- listen: local bind IP and port
- - 0.0.0.0 means listen on all interfaces
- - You can specify a specific IP like 192.168.1.100
- remote: forward target
- - Use the WarpTok entry IP and port
- - Available in the WarpTok console
- no_tcp: disable TCP (default false)
- use_udp: enable UDP (default false)
Using with WarpTok
Architecture
Typical three‑layer forwarding
- App/Client → Local Realm → WarpTok Entry → Target Server
- Example (TikTok Live):
- OBS (streaming software)
- ↓ stream to local
- 127.0.0.1:8080 (Realm listen)
- ↓ forward to WarpTok
- 203.0.113.45:1935 (WarpTok entry)
- ↓ WarpTok forward
- live.tiktok.com:1935 (TikTok server)
Setup steps
- 1. Configure target address in WarpTok console
- - Target IP: live.tiktok.com
- - Target port: 1935
- 2. Record WarpTok entry address
- - Entry IP: e.g. 203.0.113.45
- - Entry port: e.g. 1935
- 3. Create Realm config
- - listen: 0.0.0.0:8080
- - remote: 203.0.113.45:1935
- 4. Configure OBS
- - Server: rtmp://127.0.0.1:8080/live
Advanced configuration
Multi‑port forwarding
Forward multiple ports at once
# config.toml
[network]
no_tcp = false
use_udp = true
# Rule 1: RTMP streaming
[[endpoints]]
listen = "0.0.0.0:8080"
remote = "203.0.113.45:1935"
# Rule 2: HTTP API
[[endpoints]]
listen = "0.0.0.0:8081"
remote = "203.0.113.46:80"
# Rule 3: WebSocket
[[endpoints]]
listen = "0.0.0.0:8082"
remote = "203.0.113.47:443"Load balancing
Use multiple WarpTok entries for load balancing
[[endpoints]]
listen = "0.0.0.0:8080"
remote = "203.0.113.45:1935"
[[endpoints]]
listen = "0.0.0.0:8080"
remote = "203.0.113.46:1935"
# Realm will balance traffic between the two remote addressesEnable logging
# config.toml
[log]
level = "info"
output = "/var/log/realm.log"
# level values: trace, debug, info, warn, error
# output specifies log file pathRun Realm
Run in foreground (testing)
# Linux/macOS
realm -c config.toml
# Windows
realm.exe -c config.toml
# If you see "Realm is running..." the service startedRun in background (production)
Use systemd (Linux)
# 1. Create systemd unit
sudo nano /etc/systemd/system/realm.service
# 2. Add the following:
[Unit]
Description=Realm Port Forwarding
After=network.target
[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/realm -c /etc/realm/config.toml
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
# 3. Start service
sudo systemctl daemon-reload
sudo systemctl start realm
sudo systemctl enable realm # start on boot
# 4. Check status
sudo systemctl status realm
# 5. View logs
sudo journalctl -u realm -fRun in background on Windows
- Method 1: Use NSSM (recommended)
- - Download NSSM: nssm.cc
- - Run: nssm install Realm
- - Path: C:\realm\realm.exe
- - Arguments: -c C:\realm\config.toml
- - Click Install service
- Method 2: Use Task Scheduler
- - Open Task Scheduler
- - Create a basic task
- - Trigger: At startup
- - Action: start realm.exe
Monitoring and maintenance
Check service status
# Linux (systemd)
sudo systemctl status realm
# View logs
sudo journalctl -u realm -n 100
# Check ports
sudo netstat -tlnp | grep realm
# or
sudo ss -tlnp | grep realmPerformance monitoring
- Use top or htop to monitor CPU and memory
- Use iftop or nload to monitor network traffic
- Check log file size regularly to avoid disk fill
- View traffic usage in the WarpTok console
Restart service
# Linux
sudo systemctl restart realm
# Windows (NSSM)
nssm restart Realm
# Manual stop/start
# Find process ID
ps aux | grep realm
# Kill process
kill -9 <PID>
# Restart
realm -c config.toml &Troubleshooting
Connection failed
- Check config file syntax
- Verify WarpTok entry IP and port
- Use telnet to test connectivity:
- telnet 203.0.113.45 1935
- Check firewall rules
- Review Realm logs for errors
High latency
- Switch entry region in WarpTok console
- Check local server network quality
- Use ping to measure latency to the entry
- Consider upgrading server bandwidth
Service exits unexpectedly
- Check logs for errors
- Ensure sufficient system resources
- Verify config file hasn't changed
- Use systemd auto-restart
Best practices
Security tips
- Do not expose Realm listen ports to the public Internet
- If public access is needed, restrict source IPs with a firewall
- Update Realm regularly
- Use non‑standard ports for added security
- Set config file permissions to 600
Performance optimization
- Deploy Realm close to your users or servers
- Store logs on SSD
- Set an appropriate log level to reduce I/O
- Clean up old log files regularly
- Monitor system resource usage
High availability
- Deploy multiple Realm instances for redundancy
- Use different WarpTok entry addresses
- Configure health checks and failover
- Set up monitoring alerts