Runs on different ports, uses wss if URL is https.
parent
f0295031e9
commit
00badeaf63
|
@ -358,7 +358,13 @@ model = {
|
||||||
projects-list: []
|
projects-list: []
|
||||||
}
|
}
|
||||||
|
|
||||||
socket = new WebSocket "ws://localhost:8888/socket"
|
protocol = if location.protocol == 'https' then 'wss' else 'ws'
|
||||||
|
port = if location.port then \: + location.port else ''
|
||||||
|
socket-url = protocol + '://' + location.hostname + port + "/socket"
|
||||||
|
|
||||||
|
console.log socket-url
|
||||||
|
|
||||||
|
socket = new WebSocket socket-url
|
||||||
|
|
||||||
socket.onopen = (event) ->
|
socket.onopen = (event) ->
|
||||||
# Nothing to do here ATM.
|
# Nothing to do here ATM.
|
||||||
|
|
|
@ -30,11 +30,13 @@ get "/" do
|
||||||
File.read "index.html"
|
File.read "index.html"
|
||||||
end
|
end
|
||||||
|
|
||||||
get "/style.css" do
|
get "/style.css" do |env|
|
||||||
|
env.response.content_type = "text/css"
|
||||||
File.read "style.css"
|
File.read "style.css"
|
||||||
end
|
end
|
||||||
|
|
||||||
get "/main.js" do
|
get "/main.js" do |env|
|
||||||
|
env.response.content_type = "text/javascript"
|
||||||
File.read "main.js"
|
File.read "main.js"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue