Skip to content

Instantly share code, notes, and snippets.

@geor-g
Forked from duncanturk/get_stun.py
Created April 11, 2020 00:16
Show Gist options
  • Save geor-g/f0bafc277a5f0518449be88bd5e59472 to your computer and use it in GitHub Desktop.
Save geor-g/f0bafc277a5f0518449be88bd5e59472 to your computer and use it in GitHub Desktop.
python script that whether a jitsi instance uses googles stun servers
import requests as req
import re
domains = [
"jitsi.linux.it",
"chat01.kuketz-meet.de"
]
bad_stuns = {
r"stun[\d]{0,1}\.l\.google\.com": "Google"
}
for domain in domains:
page = req.get('https://' + domain + "/testmeeting")
if page.status_code != 200:
print("error testing " + domain + ": " + page)
continue
is_bad = False
for (bad_stun, reason) in bad_stuns.items():
matches = re.findall("\n.*" + bad_stun, page.text)
for match in matches:
if "//" not in match:
print(domain + " uses " + reason)
is_bad = True
break
if not is_bad:
print(domain + " is good")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment