Coverage for /home/antoine/projects/xpra-git/dist/python3/lib64/python/xpra/net/websockets/headers/default.py : 100%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# This file is part of Xpra.
2# Copyright (C) 2019-2020 Antoine Martin <antoine@xpra.org>
3# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
4# later version. See the file COPYING for details.
7from xpra.os_util import strtobytes
9HEADERS = {
10 b"Connection" : b"Upgrade",
11 b"Upgrade" : b"websocket",
12 b"Sec-WebSocket-Version" : b"13",
13 b"Sec-WebSocket-Protocol" : b"binary",
14 }
17def get_headers(host, port):
18 headers = HEADERS.copy()
19 if host:
20 headers[b"Host"] = strtobytes("%s:%s" % (host, port))
21 return headers