环境
- V2Ray 4.23.1
- Apache 2.4
- v2rayN V3.18
V2Ray Config
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
{ "inbounds": [{ "port": 30000, "listen": "127.0.0.1", "protocol": "vmess", "settings": { "clients": [ { "id": "5df411c8-da98-44f5-ac1b-3b32ccdd8ce7", "level": 1, "alterId": 64 } ] }, "streamSettings":{ "network": "ws", "wsSettings": { "path": "/random" } } }], "outbounds": [{ "protocol": "freedom", "settings": {} },{ "protocol": "blackhole", "settings": {}, "tag": "blocked" }], "routing": { "rules": [ { "type": "field", "ip": ["geoip:private"], "outboundTag": "blocked" } ] } } |
Apache Config
Enable Mod
1 2 3 4 |
a2enmod proxy a2enmod proxy_http a2enmod proxy_wstunnel a2enmod ssl |
Get SSL Certificate
1 2 3 |
wget https://dl.eff.org/certbot-auto chmod a+x ./certbot-auto ./certbot-auto --apache certonly -d test.minirplus.com |
Config file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
<IfModule mod_ssl.c> <VirtualHost *:443> ServerName test.minirplus.com DocumentRoot /var/www/ ServerSignature Off <Directory /var/www/ > Options -Indexes </Directory> RewriteEngine On RewriteCond %{HTTP:Connection} Upgrade [NC] RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteRule /(.*) ws://127.0.0.1:30000/$1 [P,L] ProxyRequests off <Location /random > ProxyPass http://127.0.0.1:30000/ ProxyPassReverse / </Location> SSLEngine on SSLCertificateFile /etc/letsencrypt/live/test.minirplus.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/test.minirplus.com/privkey.pem </VirtualHost> </IfModule> |
v2rayN Config
1 2 3 4 5 6 7 8 9 10 11 12 13 |
{ "v": "2", "ps": "TEST | US | V2Ray-Dev", "add": "test.minirplus.com", "port": "443", "id": "5df411c8-da98-44f5-ac1b-3b32ccdd8ce7", "aid": "64", "net": "ws", "type": "none", "host": "", "path": "/random", "tls": "tls" } |
There are no comments yet