simpleWebsocketClient 同时支持 ws , wss
By
terrorist
at 2021-04-09 • 0人收藏 • 1151人看过
https://github.com/btx638/HP-Socket-aardio/tree/master/aaz/libhpsocket/app/simpleWebsocketClient
import win.ui; /*DSG{{*/ var winform = win.form(text="aardio form";right=759;bottom=469) winform.add( button={cls="button";text="发送";left=216;top=104;right=400;bottom=144;z=1}; edit={cls="edit";text="您好";left=112;top=104;right=208;bottom=144;edge=1;multiline=1;z=2} ) /*}}*/ io.open() import aaz.libhpsocket.app.simpleWebsocketClient.ws; var ws = aaz.libhpsocket.app.simpleWebsocketClient.ws(); ws.on("open", lambda() io.print("已连接")) ws.on("close", lambda() io.print("已断开")) ws.on("message", lambda(msg) io.print("接收到", msg)) ws.origin = "http://coolaf.com"; ws.connect("ws://82.157.123.54:9010/ajaxchattest"); winform.button.oncommand = function(id,event){ ws.send(winform.edit.text) } winform.show(); win.loopMessage();
登录后方可回帖