first add
This commit is contained in:
13
client/docker-compose.yml
Normal file
13
client/docker-compose.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
v2ray-client:
|
||||
image: v2fly/v2fly-core:latest
|
||||
container_name: v2ray-client
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./v2ray-client.json:/etc/v2ray/config.json:ro
|
||||
command: ["run", "-c", "/etc/v2ray/config.json"]
|
||||
ports:
|
||||
- "1080:1080" # SOCKS5
|
||||
- "8080:8080" # HTTP
|
||||
58
client/test-speed.ps1
Normal file
58
client/test-speed.ps1
Normal file
@@ -0,0 +1,58 @@
|
||||
param(
|
||||
[ValidateSet("http","socks")]
|
||||
[string]$Mode = "http",
|
||||
|
||||
[int]$SizeMB = 50
|
||||
)
|
||||
|
||||
# Build proxy value and target URL
|
||||
$proxy = if ($Mode -eq "http") { "http://127.0.0.1:8080" } else { "socks5h://127.0.0.1:1080" }
|
||||
$envVar = if ($Mode -eq "http") { "HTTPS_PROXY" } else { "ALL_PROXY" }
|
||||
$bytes = [int64]$SizeMB * 1MB
|
||||
$testUrl = "https://speed.cloudflare.com/__down?bytes=$bytes"
|
||||
|
||||
Write-Host "Mode: $Mode Proxy: $proxy Size: $SizeMB MB" -ForegroundColor Cyan
|
||||
|
||||
# Set proxy env only for this process
|
||||
[System.Environment]::SetEnvironmentVariable($envVar, $proxy, 'Process')
|
||||
|
||||
function Test-Health {
|
||||
try {
|
||||
Write-Host "Checking server health via proxy..." -ForegroundColor Yellow
|
||||
$health = & curl.exe -I https://molecular.eu.org/_health 2>&1
|
||||
$line = ($health | Select-String -Pattern "HTTP/").ToString()
|
||||
Write-Host $line -ForegroundColor Green
|
||||
} catch {
|
||||
Write-Host "Health check failed: $_" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
|
||||
function Test-Download {
|
||||
param([string]$Url)
|
||||
Write-Host "Running download test: $Url" -ForegroundColor Yellow
|
||||
$result = & curl.exe -sS -o NUL -w "time_namelookup=%{time_namelookup} time_connect=%{time_connect} time_starttransfer=%{time_starttransfer} time_total=%{time_total} speed_download=%{speed_download}\n" $Url
|
||||
if (-not $result) { Write-Host "curl produced no output." -ForegroundColor Red; return }
|
||||
|
||||
$kv = @{}
|
||||
foreach ($pair in $result.Trim().Split(' ')) {
|
||||
if ($pair -match "=") {
|
||||
$k,$v = $pair.Split('='); $kv[$k] = [double]$v
|
||||
}
|
||||
}
|
||||
$mbps = [math]::Round(($kv['speed_download'] * 8.0) / 1e6, 2)
|
||||
Write-Host ("Latency(connect): {0} s | TTFB: {1} s | Total: {2} s | Throughput: {3} Mbps" -f `
|
||||
$kv['time_connect'], $kv['time_starttransfer'], $kv['time_total'], $mbps) -ForegroundColor Green
|
||||
}
|
||||
|
||||
Test-Health
|
||||
Test-Download -Url $testUrl
|
||||
|
||||
# Optional: run a smaller warm-up and a larger sustained test
|
||||
if ($SizeMB -lt 20) {
|
||||
Test-Download -Url "https://speed.cloudflare.com/__down?bytes=20000000" # 20MB
|
||||
}
|
||||
if ($SizeMB -lt 100) {
|
||||
Test-Download -Url "https://speed.cloudflare.com/__down?bytes=100000000" # 100MB
|
||||
}
|
||||
|
||||
Write-Host "Done." -ForegroundColor Cyan
|
||||
47
client/v2ray-client-grpc.json
Normal file
47
client/v2ray-client-grpc.json
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "info"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"port": 1080,
|
||||
"listen": "0.0.0.0",
|
||||
"protocol": "socks",
|
||||
"settings": { "auth": "noauth", "udp": true }
|
||||
},
|
||||
{
|
||||
"port": 8080,
|
||||
"listen": "0.0.0.0",
|
||||
"protocol": "http",
|
||||
"settings": {}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"vnext": [
|
||||
{
|
||||
"address": "molecular.eu.org",
|
||||
"port": 443,
|
||||
"users": [
|
||||
{ "id": "8f5e3b57-5a3d-4a3e-9f3c-9c6c2d6a9f1e", "encryption": "none" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "grpc",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"serverName": "molecular.eu.org",
|
||||
"alpn": ["h2"]
|
||||
},
|
||||
"grpcSettings": {
|
||||
"serviceName": "grpc",
|
||||
"multiMode": true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
43
client/v2ray-client.json
Normal file
43
client/v2ray-client.json
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "info"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"port": 1080,
|
||||
"listen": "0.0.0.0",
|
||||
"protocol": "socks",
|
||||
"settings": { "auth": "noauth", "udp": true }
|
||||
},
|
||||
{
|
||||
"port": 8080,
|
||||
"listen": "0.0.0.0",
|
||||
"protocol": "http",
|
||||
"settings": {}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"vnext": [
|
||||
{
|
||||
"address": "molecular.eu.org",
|
||||
"port": 443,
|
||||
"users": [
|
||||
{ "id": "8f5e3b57-5a3d-4a3e-9f3c-9c6c2d6a9f1e", "encryption": "none" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "grpc",
|
||||
"security": "tls",
|
||||
"grpcSettings": {
|
||||
"serviceName": "grpc",
|
||||
"multiMode": true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
48
client/v2ray-clientbak.json
Normal file
48
client/v2ray-clientbak.json
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "info"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"port": 1080,
|
||||
"listen": "0.0.0.0",
|
||||
"protocol": "socks",
|
||||
"settings": {
|
||||
"auth": "noauth",
|
||||
"udp": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"port": 8080,
|
||||
"listen": "0.0.0.0",
|
||||
"protocol": "http",
|
||||
"settings": {}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"vnext": [
|
||||
{
|
||||
"address": "molecular.eu.org",
|
||||
"port": 443,
|
||||
"users": [
|
||||
{
|
||||
"id": "8f5e3b57-5a3d-4a3e-9f3c-9c6c2d6a9f1e",
|
||||
"encryption": "none"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "ws",
|
||||
"security": "tls",
|
||||
"wsSettings": {
|
||||
"path": "/ray"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user