Proxy servers play a vital role in managing and routing network traffic, offering solutions for load balancing, caching, and enhanced security.
Our proxy servers is meticulously designed to be lightweight, efficient, and highly customizable. It supports both HTTP and HTTPS protocols and comes equipped with features like keep-alive requests, logging, and robust CORS handling. Additionally, It allows you to use third-party APIs directly in the UI or AVgator® Studio, even if those APIs don’t support CORS or HTTPS.
Key Features
Cross-Platform Compatibility: Supports Windows, macOS, Raspberry Pi, and Linux.
HTTP and HTTPS Support: Handles both HTTP and HTTPS traffic.
Keep-Alive Requests: Maintain uninterrupted connections automatically.
Configurable Logging: Supports logging to a file with rotation based on file size.
Dynamic Configuration Reloading: Automatically reloads configuration changes without restarting the server.
CORS Handling: Seamlessly handle cross-origin requests, preflight requests, and more.
Configuration
The proxy server is configured using a JSON file. Here's an example configuration file (config.json):
{
"hosts": [
{
"prefix": "hostone",
"auth": {
"type": "crestronHome",
"token": "NgPkQG2zc5Wn",
"url": "https://192.168.254.227/cws/api/login"
},
"url": "https://192.168.254.227"
},
{
"prefix": "hosttwo",
"url": "http://192.168.254.203",
"autonomic": {
"heartbeat_url":
"http://192.168.254.203/api/?clientId=0d933545-fa6a-47fc-90de-0f20db9745ab"
}
}
],
"mode": "debug",
"log-file": "/var/log/proxy.log"
}
Detailed Explanation of the Configuration
- mode: Specifies the mode of the application. It can be either debug or production . If not
specified, it defaults to production .
- log-file: Specifies the log file name and location. If not specified, it defaults to proxy.log in the binary's directory.
- hosts: An array of host configurations. Each host configuration includes:
- prefix: The prefix for the host. Requests with this prefix will be proxied to the specified URL.
- auth: The authentication configuration. If the type is crestronHome , the token and url fields are required. crestronHome is a specific type of authentication used for Crestron Home systems.
- autonomic: The autonomic configuration. If specified, keepalive requests will be sent to the heartbeat_url every 20 seconds. autonomic refers to the Autonomic music server
- url: The URL to proxy requests to.
Running the Proxy Server
You can run the proxy server with the following command:
./proxyserver
Make sure the configuration file (config.json) and SSL certificates are in the appropriate directories as expected by the program.
You can choose our prepared Proxy Server for your OS to create AV projects in AVgator® Studio. Go to our shop and select packaged suitable item for you.
Comentarios