Skip to content

Instantly share code, notes, and snippets.

@m-j-w
m-j-w / server_sent_events.jl
Created Apr 22, 2017
HTTP5 Server Sent Event in Julia
View server_sent_events.jl
# 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>