| English | Korean | Chinese | Japanese |
Chapter 9. Deploying to the Client Server
Live and Playback Demo page
You can find the source files in the local base path. (You need to copy these files into your configuration directory.)
http://<address>:<port>/
http://<address>:<port>/live.html
http://<address>:<port>/liveHLS.html
http://<address>:<port>/playback.html
http://<address>:<port>/playbackFiles.html
http://<address>:<port>/events.html
http://<address>:<port>/map.html
http://<address>:<port>/status.html
You can move the demo example code to your server and run it:
1. Copy the demo files to your server's httpdoc path.
2. Set the Allowed Origins (CORS) as follows:
· Windows web server: Set Allowed Origins (CORS) in the configuration.
· Linux Docker container web server: Add the `--http_cors` option.
3. Change the `gBaseURL` variable in the `lib.js` file to the external public address of your router. The URL must use HTTPS.
// [[ httpdoc_base_path/lib.js ]]
var gBaseURL = "https://your-public-ip-or-domain:8443"; // public address (HTTPS)
.. or ..
var gBaseURL = "https://your.xxx.ddns.com";
4. Configure external access using a reverse proxy:
· Deploy a reverse proxy server (e.g., nginx) with HTTPS enabled.
· Configure the proxy to forward incoming requests to the internal WebAPI server (e.g., http://192.168.1.90).
· Use an SSL/TLS certificate (e.g., issued by Let's Encrypt) for secure HTTPS connections.
· The following is an example of an nginx configuration (/etc/nginx/sites-available/default).
server {
listen 443 ssl;
server_name your.webserver.url;
ssl_certificate /etc/letsencrypt/live/your.webserver.url/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/your.webserver.url/privkey.pem;
location / {
proxy_pass http://192.168.1.90:8080;
}
}
5. Configure the router for port forwarding:
· Forward an external port (e.g., 447) to the reverse proxy server's internal IP address (e.g., 192.168.1.228).
6. Use a public domain for client access:
· Clients should access the service via a public URL (e.g., http://public.url.com or https://public.url.com).

