v7: proxied session jumps — Nord egress dropdown (Tokyo/London/Sydney), sticky rotate per user, home-IP option

This commit is contained in:
2026-09-25 20:45:05 -07:00
parent ba3e90fe29
commit cba8a8f0ca
2 changed files with 39 additions and 9 deletions

View File

@@ -31,10 +31,11 @@ class Handler(BaseHTTPRequestHandler):
data = json.loads(self.rfile.read(ln))
domain = data.get("domain", "")
cookies = data.get("cookies", [])
proxy = data.get("proxy", "") # e.g. "http://10.30.20.154:3128"
if not domain or not cookies:
self._json(400, {"ok": False, "error": "domain and cookies required"}); return
tok = "%s_%d" % (re.sub(r'[^a-z0-9]', '', domain.lower())[:20], int(time.time()))
threading.Thread(target=launch, args=(domain, cookies, tok), daemon=True).start()
threading.Thread(target=launch, args=(domain, cookies, tok, proxy), daemon=True).start()
self._json(200, {"ok": True, "launched": len(cookies), "token": tok})
except Exception as e:
self._json(500, {"ok": False, "error": str(e)})
@@ -47,7 +48,7 @@ class Handler(BaseHTTPRequestHandler):
self.end_headers()
self.wfile.write(body)
def launch(domain, cookies, tok):
def launch(domain, cookies, tok, proxy=""):
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
opts = Options()
@@ -59,6 +60,8 @@ def launch(domain, cookies, tok):
opts.add_argument("--start-maximized")
opts.add_argument("--window-size=1440,900")
opts.add_argument("--disable-gpu")
if proxy:
opts.add_argument("--proxy-server=" + proxy)
from selenium.webdriver.chrome.service import Service
svc = Service(executable_path=os.path.join(SESSION_DIR, "..", "chromedriver.exe"))
driver = webdriver.Chrome(service=svc, options=opts)