PHub Admin

Active 0
Disconnected 0
Proxy Users
No proxy users yet

WebTransport

WebTransport runs over HTTP/3 (QUIC, UDP port 8080). Connect from a browser or any WebTransport client.

Browsers cannot send user:pass@ credentials with WebTransport — the URL credentials are stripped before the request is sent, the hub sees no auth and rejects the session ("WebTransport connection rejected"). Always pass credentials in the auth query parameter as base64(username:password). The WT URLs on the Proxy Users tab are already in this form — use their Copy button. Non-browser clients may use HTTP Basic auth instead.

Connection URL
https://<host>:8080/proxy/?auth=<base64(username:password)>

Open a bidirectional stream and send the destination as the first line:

Stream protocol
host:port\n <then pipe raw TCP data in both directions>
Browser test (DevTools console)
const auth = btoa('user:pass'); const wt = new WebTransport(`https://host:8080/proxy/?auth=${encodeURIComponent(auth)}`); await wt.ready; const stream = await wt.createBidirectionalStream(); const w = stream.writable.getWriter(); const enc = new TextEncoder(); await w.write(enc.encode('api.ipify.org:80\n')); await w.write(enc.encode('GET / HTTP/1.0\r\nHost: api.ipify.org\r\nConnection: close\r\n\r\n')); const r = stream.readable.getReader(); const { value } = await r.read(); console.log(new TextDecoder().decode(value));
If the connection is rejected
1. auth param missing or wrong — credentials must be base64(username:password), URL-encoded. user:pass@ in the URL does NOT work in browsers. 2. The assigned worker is offline — check the Workers tab. 3. Your network blocks outbound UDP 8080 — WebTransport cannot fall back to TCP; use the SOCKS5 proxy instead. Hub side: docker logs show every attempt ("WebTransport: request / auth missing / worker offline / upgrade failed").

WebTransport — Webpage

Full standalone HTML page that proxies HTTP requests via WebTransport. Browsers require HTTPS and a trusted TLS cert on the proxy host.

webtransport-proxy.html
<!DOCTYPE html> <html><body> <pre id="out">Loading...</pre> <script> async function fetchViaProxy(host, port, httpRequest) { const auth = btoa('user:pass'); const wt = new WebTransport( `https://<host>:8080/proxy/?auth=${encodeURIComponent(auth)}` ); await wt.ready; const stream = await wt.createBidirectionalStream(); const enc = new TextEncoder(); const w = stream.writable.getWriter(); await w.write(enc.encode(`${host}:${port}\n`)); await w.write(enc.encode(httpRequest)); const r = stream.readable.getReader(); const { value } = await r.read(); wt.close(); return new TextDecoder().decode(value); } fetchViaProxy('api.ipify.org', 80, 'GET / HTTP/1.0\r\nHost: api.ipify.org\r\n\r\n' ).then(resp => document.getElementById('out').textContent = resp) .catch(e => document.getElementById('out').textContent = 'Error: ' + e); </script> </body></html>

WebTransport — Token Auth (HMAC)

For connecting directly from your own website's pages without embedding the static proxy password (which any visitor could read and reuse forever). Enable token auth on a proxy user (Proxy Users tab → "Enable token auth"), keep the HMAC secret on your backend only, and mint a short-lived token per page view. A leaked token dies at its expiry; the token is checked only at session setup, so an open session outlives it.

Token format
t:<unix-expiry>:<proxy-user-id>:<hex hmac-sha256(secret, "<unix-expiry>:<proxy-user-id>")> usage: https://<host>:8080/proxy/?auth=<token> The proxy-user id is shown next to the HMAC secret on the Proxy Users tab.
Mint on your backend — Node.js
const crypto = require('crypto'); function mintToken(userID, secret, ttlSec = 300) { const exp = Math.floor(Date.now() / 1000) + ttlSec; const mac = crypto.createHmac('sha256', secret).update(`${exp}:${userID}`).digest('hex'); return `t:${exp}:${userID}:${mac}`; }
PHP
function mint_token(string $userID, string $secret, int $ttl = 300): string { $exp = time() + $ttl; $mac = hash_hmac('sha256', "$exp:$userID", $secret); return "t:$exp:$userID:$mac"; }
Go
func mintToken(userID, secret string, ttl time.Duration) string { exp := time.Now().Add(ttl).Unix() mac := hmac.New(sha256.New, []byte(secret)) fmt.Fprintf(mac, "%d:%s", exp, userID) return fmt.Sprintf("t:%d:%s:%s", exp, userID, hex.EncodeToString(mac.Sum(nil))) }
Delphi (10.1+, System.Hash)
uses System.SysUtils, System.Hash, System.DateUtils; function MintToken(const UserID, Secret: string; TTLSec: Integer): string; var Exp: Int64; Mac: string; begin Exp := DateTimeToUnix(Now, False) + TTLSec; Mac := THashSHA2.GetHMAC(IntToStr(Exp) + ':' + UserID, Secret, THashSHA2.TSHA2Version.SHA256); Result := Format('t:%d:%s:%s', [Exp, UserID, LowerCase(Mac)]); end;
In the visitor's browser
// token comes from YOUR backend (e.g. rendered into the page or fetched) const wt = new WebTransport(`https://host:8080/proxy/?auth=${encodeURIComponent(token)}`);

Keep the TTL short (60–300s). Static username/password auth keeps working alongside tokens. Regenerating the HMAC secret invalidates all outstanding tokens for that user.

SOCKS5

Standard SOCKS5 proxy with username/password auth. Works with any SOCKS5-compatible client.

Connection
socks5h://<username>:<password>@<host>:1080
curl
curl -x socks5h://user:pass@host:1080 https://api.ipify.org
PowerShell (7+ built-in / curl.exe)
# PowerShell 7+ $env:ALL_PROXY = 'socks5://user:pass@host:1080' Invoke-WebRequest https://api.ipify.org # curl.exe (bundled with Windows 10+) curl.exe -x socks5h://user:pass@host:1080 https://api.ipify.org
PHP (cURL extension)
<?php $ch = curl_init('https://api.ipify.org'); curl_setopt($ch, CURLOPT_PROXY, 'socks5h://host:1080'); curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'user:pass'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); echo curl_exec($ch); curl_close($ch);
Python (requests + PySocks)
pip install requests[socks] import requests proxies = {'http': 'socks5h://user:pass@host:1080', 'https': 'socks5h://user:pass@host:1080'} print(requests.get('https://api.ipify.org', proxies=proxies).text)
Delphi / RAD Studio (Indy)
uses IdHTTP, IdSSLOpenSSL, IdSocks, IdIOHandlerStack; var HTTP: TIdHTTP; IOH: TIdIOHandlerStack; Socks: TIdSocksInfo; SSL: TIdSSLIOHandlerSocketOpenSSL; // RAD Studio / Indy 10 only begin // --- plain HTTP via SOCKS5 (Delphi 7 + Indy 9/10) --- HTTP := TIdHTTP.Create(nil); IOH := TIdIOHandlerStack.Create(HTTP); Socks := TIdSocksInfo.Create(IOH); Socks.Host := 'host'; Socks.Port := 1080; Socks.Version := svSocks5; Socks.Username := 'user'; Socks.Password := 'pass'; IOH.SocksInfo := Socks; HTTP.IOHandler := IOH; ShowMessage(HTTP.Get('http://api.ipify.org')); HTTP.Free; // --- HTTPS (RAD Studio / Indy 10 + OpenSSL DLLs) --- HTTP := TIdHTTP.Create(nil); SSL := TIdSSLIOHandlerSocketOpenSSL.Create(HTTP); Socks := TIdSocksInfo.Create(SSL); Socks.Host := 'host'; Socks.Port := 1080; Socks.Version := svSocks5; Socks.Username := 'user'; Socks.Password := 'pass'; SSL.SocksInfo := Socks; HTTP.IOHandler := SSL; ShowMessage(HTTP.Get('https://api.ipify.org')); HTTP.Free; end;

Server

Uptime: —