mirror of
https://github.com/moparisthebest/mailcatcher
synced 2024-12-22 07:18:53 -05:00
parent
e76d367755
commit
d3f083f8df
@ -292,8 +292,9 @@ class MailCatcher
|
||||
@subscribePoll()
|
||||
|
||||
subscribeWebSocket: ->
|
||||
secure = window.location.scheme == "https"
|
||||
@websocket = new WebSocket("#{if secure then "wss" else "ws"}://#{window.location.host}/messages")
|
||||
secure = window.location.protocol is "https:"
|
||||
protocol = if secure then "wss" else "ws"
|
||||
@websocket = new WebSocket("#{protocol}://#{window.location.host}/messages")
|
||||
@websocket.onmessage = (event) =>
|
||||
@addMessage $.parseJSON event.data
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user