This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 配置文件所在目录 | |
CONFIG_DIR='/home/ff/ovpn-data-example' | |
# 服务器ip | |
# SERVER_DOMAIN_IP='192.168.2.133' | |
SERVER_DOMAIN_IP=`curl -s ipinfo.io/ip` | |
# 暴露的 UDP 端口 | |
EXPORT_PORT='1194' | |
# 客户端名字 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http2 = require('http2'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const zlib = require('zlib'); | |
const brotli = require('brotli'); // npm package | |
const PORT = 3032; | |
const BROTLI_QUALITY = 11; // slow, but we're caching so who cares | |
const STATIC_DIRECTORY = path.resolve(__dirname, '../dist/'); | |
const cache = {}; |