Hide keyboard shortcuts

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. 

5 

6 

7from xpra.os_util import strtobytes 

8 

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 } 

15 

16 

17def get_headers(host, port): 

18 headers = HEADERS.copy() 

19 if host: 

20 headers[b"Host"] = strtobytes("%s:%s" % (host, port)) 

21 return headers