• sales

    +86-0755-88291180

NanoKVM-USB Development

1. Local deployment

If only access through the local machine (localhost), certificates can be omitted.

Examples are provided here for Node.js and Python.

1.1. Node.js Service

  1. Open the terminal and enter the NanoKVM-USB directory in the previous step.
  2. Execute npm install -g http-server to install http-server.
  3. Execute http-server -p 8080 -a localhost to run the service.

1.2. Python Service

  1. Open the terminal and enter the NanoKVM-USB directory in the previous step.
  2. Execute python -m http.server 8080 to run the service.

1.3. Visit on browser

After the service is started, open the browser and visit http://localhost:8080.

Note that you can only use the http protocol, not the https protocol.

2. Local network deployment

If access is needed within the local area network, a certificate is required.

Examples are provided here for Node.js and Python. The difference from the above is that a certificate is required.

2.1. Generate Certificate

Make sure you have openssl installed.

  1. Open the terminal and enter the NanoKVM-USB directory in the previous step.
  2. Execute openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem.
  3. The terminal ask you to enter information. You can pressing the Enter key to skip it, or you can enter information as needed.

After completion, two files key.pem and cert.pem will be generated in the current directory.

2.2. Node.js Service

  1. Execute npm install -g http-server to install http-server.
  2. Execute http-server -p 8080 -S -C cert.pem -K key.pem to run the service.

2.3. Python Service

Create a file server.py in the NanoKVM-USB directory, and save it with the following code:

import http.server
import ssl

server_address = ('0.0.0.0', 8080)

httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler)
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
context.load_cert_chain(certfile='cert.pem', keyfile='key.pem')
httpd.socket = context.wrap_socket(httpd.socket, server_side=True)

print(f"Serving HTTPS on {server_address[0]}:{server_address[1]}")

httpd.serve_forever()

Execute python server.py to run the service。

2.4. Visit on browser

Open the browser and enter the service address, such as https://127.0.0.1:8080.

After opening the URL, you may be prompted with a "Privacy Error" and need to click to access manually:

3. Public network deployment

If you need to access it on the public network, it is recommended to use Nginx.

Here is a simple configuration example. For detailed configuration methods, please refer to the Nginx documentation.

server {
    listen 80;
    server_name your_domain.com www.your_domain.com; # Please replace with your domain name
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name your_domain.com www.your_domain.com; # Please replace with your domain name

    root /var/www/your_website; # Please replace with the NanoKVM-USB directory path
    index index.html index.htm;

    ssl_certificate /etc/nginx/ssl/cert.pem; # Please replace it with your certificate file path
    ssl_certificate_key /etc/nginx/ssl/key.pem; # Please replace it with your private key file path

    location / {
        try_files $uri $uri/ /index.html;
    }
}
TAG: SpotPear Raspberry Pi DSI Scr Raspberry Pi 14 inch LCD 2K HDMI /Type C Display Capacitive TouchScreen 2160x1440 For Jetson Nano/mini Computer PC Raspberry Pi Camera Case Modbus POE ETH Relay Waveshare User Guide Raspberry Pi 5 Audio ESP32 S3 5 inch LCD Development Board 800x480 TouchScreen Display TVBOX LVGL HMI Sensor CAN RS485 Industrial USB TO RS232/485 (C) UART FT232RNL 2m For 3.3V / 5V For Switchable RS232/RS485 ESP32-S3FH4R2 Matrix 8x8 RGB-LED-WiFi Bluetooth QST Attitude Gyro Sensor QMI8658C Arduino Python X1202 Raspberry Pi 5 UPS Board Uninterruptible Power Supply For 18650-Li-Battery (NOT includ) 4-Ports SpotPear ESP32-P4-ETH RJ45 POE DSI/MIPI 10.1 inch LCD Display Touchscreen/CSI Camera/Audio Speaker AI Deepseek 1.83inch LCD TouchScreen Display 240×280 NV3030B Arduino Raspberry Pi ESP32S3 Pico STM32 WiFi Wireless ESP32 DDSM Motor Driver HAT For Direct Drive Servo Hub Motors For Raspberry Pi ESP32 S3 AI 4.3inch (C) Industrial Development Board 4.3 inch TouchScreen Display Sensor CAN I2C RS485 DeepSeek TOF Time-Of-Flight Laser Range Sensor Radar Module UART / I2C Port JETSON NANO MINI Fan voice module Raspberry Pi Pico rp2040 Display image 1.3inch LCD ST7789 change bmp to hex Luckfox Pico SPI