This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TOKEN [\w\d\-\.!%\*_\+`'~]+ | |
WORD [\d\w\-\.!%\*_+`'~()<>:\\"\/\[\]?{}]+ | |
SIP_CALL_ID %{WORD}[@%{WORD}]? | |
BRANCH %{TOKEN} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wait_for_key () { | |
echo "Press any key to continue" | |
while [ true ] ; do | |
read -t 3 -n 1 | |
if [ $? = 0 ] ; then | |
break ; | |
fi | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import os | |
# pip install pyOpenSSL | |
from OpenSSL import crypto | |
def create_self_signed_cert(name=None): | |
CERT_FILE = os.path.join("certificates", name + "_cert.pem" if name else "cert.pem") | |
KEY_FILE = os.path.join("certificates", name + "_key.pem" if name else "key.pem") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import ssl | |
from tls_server import HOST as SERVER_HOST | |
from tls_server import PORT as SERVER_PORT | |
HOST = "127.0.0.1" | |
PORT = 60002 | |
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |