XX-net/XX-Net · info · NotSupported
NotSupported
Error message
NotSupported
What it means
NotSupported(req, sock) is raised from do_gae when the incoming HTTP request asks for a WebSocket upgrade (req.upgrade == b'websocket'). GAE operates as an HTTP/HTTPS relay over Google App Engine and cannot carry raw bidirectional WebSocket frames, so the router raises NotSupported to signal try_loop to try a different strategy (e.g. direct or X-Tunnel).
Source
Thrown at code/default/smart_router/local/smart_route.py:344
if req.path[0] == b'/':
url = b'%s://%s%s' % (schema, req.headers[b'Host'], req.path)
else:
url = req.path
if url in [b"http://www.twitter.com/xxnet",
b"https://www.twitter.com/xxnet",
b"http://www.deja.com/xxnet",
b"https://www.deja.com/xxnet"
]:
# for web_ui status page
# auto detect browser proxy setting is work
xlog.debug("CONNECT %s %s", req.command, req.path)
req.wfile.write(req.self_check_response_data)
return
if req.upgrade == b"websocket":
xlog.debug("gae %s not support WebSocket", req.path)
raise NotSupported(req, sock)
if len(req.path) >= 2048:
xlog.debug("gae %s path len exceed 1024 limit", req.path)
raise NotSupported(req, sock)
if req.command not in req.gae_support_methods:
xlog.debug("gae %s %s, method not supported", req.command, req.path)
raise NotSupported(req, sock)
req.parsed_url = urlparse(req.path)
req.do_METHOD()
def try_loop(scense, rule_list, sock, host, port, client_address, left_buf=""):
xlog.debug("try_loop %s %s to %s:%d", scense, rule_list, host, port)
start_time = time.time()
View on GitHub (pinned to cfa5bc17b6)
Solutions
- Add a routing rule that sends WebSocket traffic to direct or X-Tunnel instead of GAE
- Catch NotSupported in try_loop so the connection falls back to a WebSocket-capable strategy (designed behavior)
- If WebSockets are essential, consider disabling the GAE strategy for the affected hosts
Defensive patterns
Strategy: fallback
Validate before calling
if req.headers.get('Upgrade','').lower() == 'websocket':
skip_strategy('gae') Try / catch
try:
do_gae(...)
except NotSupported:
try_next_strategy(sock, host, port) # direct/X-Tunnel support websockets Prevention
- Add a pre-routing rule sending Upgrade: websocket to a WebSocket-capable strategy
- Treat NotSupported from do_gae as a normal fallback signal, not a crash
When it happens
Trigger: A client opens a WebSocket connection (Upgrade: websocket header) and the smart router routes it to the GAE strategy.
Common situations: Browsers/applications using WebSocket-based services (chat, live feeds) while GAE is the first matching routing rule.
Related errors
AI-assisted analysis of XX-net/XX-Net@cfa5bc17b6 (2026-08-27).
Data as JSON: /api/errors/6adf64ba4eda6a23.
Report an issue: GitHub.