Created
August 6, 2013 16:13
-
-
Save kost/6165980 to your computer and use it in GitHub Desktop.
Basic HTTPS server using webrick
This file contains 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
#!/usr/bin/env ruby | |
require 'openssl' | |
require 'webrick' | |
require 'webrick/https' | |
include WEBrick | |
port = 8443 | |
server = HTTPServer.new(:Port=>port,:DocumentRoot=>Dir::pwd, | |
:SSLEnable=>true, | |
:SSLCertName => [ [ "CN",WEBrick::Utils::getservername ] ] | |
) | |
trap("INT"){ server.shutdown } | |
server.start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment