Browse Source

add typing hint

akkariiin/Experimental
Akkariiin 6 years ago
parent
commit
0f141a3e4a
  1. 7
      shadowsocks/obfsplugin/plain.py

7
shadowsocks/obfsplugin/plain.py

@ -96,6 +96,13 @@ class plain(object):
pass
def get_head_size(self, buf: bytes, def_value: int) -> int:
"""
get size From SOCKS5 head type info
:param buf: bytes the header from SOCKS5
:param def_value: int if cannot detect type
:return: the header really size
"""
if len(buf) < 2:
return def_value
head_type = ord(buf[0]) & 0x7

Loading…
Cancel
Save