Skip to content

Commit

Permalink
update mwe.jl example to use SSL
Browse files Browse the repository at this point in the history
  • Loading branch information
samoconnor committed Jan 30, 2018
1 parent f576d4d commit 45f4e22
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/mwe.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using HTTP
using HTTP: hasheader
using MbedTLS

@static if is_apple()
launch(x) = run(`open $x`)
Expand All @@ -11,11 +12,12 @@ end

@async begin
sleep(2)
launch("http://127.0.0.1:8000/examples/mwe")
launch("https://127.0.0.1:8000/examples/mwe")
end

HTTP.listen(ip"127.0.0.1",8000) do http
@show http
HTTP.listen(ip"127.0.0.1", 8000,;
ssl = true,
sslconfig = MbedTLS.SSLConfig("cert.pem", "key.pem")) do http
if http.message.method == "GET" &&
hasheader(http, "Connection", "upgrade") &&
hasheader(http, "Upgrade", "websocket")
Expand Down

0 comments on commit 45f4e22

Please sign in to comment.