Skip to content

Instantly share code, notes, and snippets.

@m-j-w
m-j-w / server_sent_events.jl
Created April 22, 2017 16:26
HTTP5 Server Sent Event in Julia
# Example adapted from https://www.html5rocks.com/en/tutorials/eventsource/basics/WebSockets.jl
using HttpServer
hdr = Dict{AbstractString,AbstractString}(
[ "Content-Type" => "text/event-stream"
, "Cache-Control" => "no-cache"
, "Connection" => "keep-alive" ] )
idx = raw"""
<html><body><h1>Getting server updates</h1><div id="result"></div><script>