Skip to content

Instantly share code, notes, and snippets.

@lostcoaster
lostcoaster / websocketserver.py
Last active August 29, 2015 14:03 — forked from jkp/websocketserver.py
Make it compatible with python 3.4
#!python 3
import struct
import socketserver
from base64 import b64encode
from hashlib import sha1
import email
class WebSocketsHandler(socketserver.StreamRequestHandler):
magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'