use new api

This commit is contained in:
lxsang
2019-08-30 13:20:10 +02:00
parent 8288379482
commit 96e7662d6e
2 changed files with 3 additions and 5 deletions

View File

@ -193,8 +193,7 @@ class LuaPlayground extends this.OS.GUI.BaseApplication
me = @
value = @editor.getValue().trim()
return unless value and value isnt ""
proto = if window.location.protocol is "https:" then "wss://" else "ws://"
@socket = new WebSocket proto + @_api.HOST + "/system/apigateway?ws=1"
@socket = @stream()
@socket.onopen = () ->
#send data to server
me.socket.send( JSON.stringify { code: value } )