Skip to content

Instantly share code, notes, and snippets.

@jashkenas
Forked from bmeck/switch use.js
Created July 23, 2010 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jashkenas/487737 to your computer and use it in GitHub Desktop.
Save jashkenas/487737 to your computer and use it in GitHub Desktop.
switch(protocol) {
//first set it to secure
case "https:":
stream.setSecure(true)
case "http:":
stream.write(text)
stream.end()
break
case "ftp:":
...
}
switch protocol
when 'ftp:'
...
when 'http:', 'https:'
stream.setSecure true if protocol is 'https:'
stream.write text
stream.end()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment