Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

KeyError: u'0800' #33

Open
ofergr opened this issue Aug 19, 2020 · 0 comments
Open

KeyError: u'0800' #33

ofergr opened this issue Aug 19, 2020 · 0 comments

Comments

@ofergr
Copy link

ofergr commented Aug 19, 2020

From time to time I get the following exception:

Exception in thread StunReq:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self._kwargs)
File "stuntask.py", line 24, in run
send_stun_request()
File "stuntask.py", line 94, in send_stun_request
nat_type, ext_ip, ext_port = stun.get_ip_info(addr, 4789)
File "/home/oferg/mycode/pystun3-1.0.0/stun/init.py", line 275, in get_ip_info
stun_host=stun_host, stun_port=stun_port)
File "/home/oferg/mycode/pystun3-1.0.0/stun/init.py", line 215, in get_nat_type
ret = stun_test(s, stun_host
, port, source_ip, source_port)
File "/home/oferg/mycode/pystun3-1.0.0/stun/init.py", line 150, in stun_test
bind_resp_msg = dictValToMsgType[msgtype] == "BindResponseMsg"
KeyError: u'0800'

What can be the cause of this? I can try and catch the exception, but I have no idea what to do with it :-)

Need to add that I have changed the list of STUN server to a more current one:
STUN_SERVERS = (
'stun.l.google.com:19302',
'stun1.l.google.com:19302',
'stun2.l.google.com:19302',
'stun3.l.google.com:19302',
'stun4.l.google.com:19302',
'stun.ekiga.net'
)

Also add handling of STUN server addresses which has port in it, as in the above list (simple split(':'), nothing fancy).

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant