Scene
This functionality is designed for scenarios where the management node has a public IP address,while the rendering nodes do not have public IP addresses.
Implementation Method
By setting up a custom proxy forwarding service,the rendering nodes can forward their services to the external network via the proxy,enabling the rendering nodes without public IPs to provide services normally.
Deployment Method
• Linux Docker
After Decompression
Use thelarkxr-center-docker
folder.The directory structure is shown in the figure below.
Modify theapplication.yaml
file under theadmin
folder,following the four steps indicated by the dashed lines
# NAT Forwarding Proxy
nat-proxy:
# Enable this when using NAT forwarding to solve the issue of lacking a public IP
# 1. ------------Set to true ------------
enable: true
# Operation mode: client/server
# 2. ------------Set to server mode ------------
mode: server
# LarkXR Management Node used with an independently deployed NAT service in server mode
server-mode:
# Configure the address of the NAT Server API, such as: http://192.168.0.6:8183
# 3. ------------Set the API address for NAT service interaction ------------
api-server-address: http://192.168.0.164:8183
# LarkXR Management Node as a NAT client mode (not applicable here)
client-mode:
# NAT Server IP or domain name
server-host:
server-port: 20001
# clientKey provided by NAT Server
client-key:
# Turn Service: Windows version does not support Redis for persistent user information, while the Linux version does.
# Therefore, if the Windows version enables the server mode of the forwarding service and needs to dynamically create TURN users, an additional deployment of the Linux version of turnserver is required.
# If the Windows version is only used for forwarding WebRTC traffic, the built-in TURN can be used with the fixed user information configured in turnserver.conf.
ice:
server:
# 4. ------------Set to true to enable TURN service ------------
enable: true
Modifyturnserver.conf
When deploying in a containerized environment,the public IP address of the physical machine running TURN must be accessible over the internet.Open theturnserver.conf
file in the installation package.
# Due to network devices (such as routers, firewalls) performing Network Address Translation (NAT) between internal and external networks,
# the TURN server cannot directly obtain its external IP address. Therefore, the external-ip configuration item is used to inform the TURN server of its visible IP address on the internet.
# If the external-ip is not specified in the configuration file, the TURN server will attempt to use the default IP address.
# However, if the default address is invalid or inaccessible, a reliable TURN connection cannot be established.
# By configuring the external-ip, the actual external IP is provided to the TURN server, enabling it to correctly handle and forward network traffic.
# For example, use the public IP for cloud virtual machine deployment, and the node IP for local container deployment.
# Set to the external IP address of the physical machine
external-ip=192.168.0.164
Start Services in Docker
sh start.sh
Start Proxy Service
//Note: You need to configure the IP whitelist for interface access.For example,when starting with Docker,use the IP in the admin Docker container,which is typically172.29.0.20
.
Use the following command to start the proxy service
cd /opt/larkxr-center-docker/proxy
sh start.sh
Add Forwarding Service
Access the management backend pagehttp://{ip}:8182
,go to thePort Forwarding Managementpage.After adding the relevant configurations,the initial state of the forwarding client will beOffline.Please note that the public port and client key will be used in subsequent steps.
Configure Rendering Nodes
Modify theapplication.properties
file to configure the center management node URL and private IP address.
# Center management node URL, it is usually recommended to configure it to the LarkXR gateway's access address, such as http://192.168.0.20:8181
pxy.admin-server.url=http://192.168.0.164:8181
# !!! This machine's private IP address
pxy.host.local-ip=192.168.0.28
Modify the public IP address
# !!! This machine's public IP address: Set this value when public access is required and the node has been assigned a public IP
# Change to the public IP of the NAT service
pxy.host.public-ip=192.168.0.164
Modify the default port 10002
# Rendering server: Client connection port - Ordinary TCP port. The "public port" in the forwarding port data.
pxy.render-server.listen-port=20006
Modify the forwarding proxy settings
###########NAT Forwarding Proxy##############
# Enable this when using NAT forwarding to solve the issue of lacking a public IP
# Change to true
pxy.nat-proxy.enable=true
# LarkXR management node as NAT client mode
# NAT Server IP or domain name
# Change to the public IP of the NAT service
pxy.nat-proxy.client-mode.server-host=192.168.0.164
pxy.nat-proxy.client-mode.server-port=20001
# clientKey provided by NAT Server
# "clientKey" in the forwarding port data
pxy.nat-proxy.client-mode.client-key=#######
Modify ICE configuration
# Format: turn:47.94.38.44:19303
# The TURN URI for the proxy forwarding service, which is deployed together with the admin by default. The default port number is 13478.
pxy.ice.server.uri=turn:192.168.0.164:13478
# "clientId" in the forwarding port data
pxy.ice.server.username=1328310734890729472
# "clientKey" in the forwarding port data
pxy.ice.server.password=b2f216b331ec4879846a70efdb6f3a43
# Set to 1 to force the use of TURN
pxy.ice.transport=1
Start Services
Access Application
Access the application overview through the management nodes IP address.Ensure you can correctly enter the application.