Advertisement
Guest User

Untitled

a guest
Jul 8th, 2011
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1.     scheme = parsed.scheme
  2.     if scheme == 'http': scheme = 'ws'
  3.     is_secure = False
  4.     if scheme == "ws":
  5.         if not port:
  6.             port = 80
  7.     elif scheme == "wss":
  8.         is_secure = True
  9.         if not port:
  10.             port  = 443
  11.     else:
  12.         raise ValueError("scheme %s is invalid" % scheme)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement