If ProcessExists("http-websocket.exe")=0 Then
Run("http-websocket.exe")
EndIf
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$bb="nihao"
$bb=StringToBinary($bb)
$bb="wsurl=wss://echo.websocket.org&wssend="&$bb
$oHTTP.Open("get","http://127.0.0.1:9988/send?"&$bb,false)
$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
$oHTTP.Send()
$HTMLSource = $oHTTP.Responsetext
$HTMLSource = Encode2Unicode($HTMLSource)
$HTMLSource=StringReplace($HTMLSource,"","")
MsgBox(0,"",$HTMLSource)
Func Encode2Unicode($str)
$Temp = StringRegExp($str, '(\\u\w{4})', 3)
If @error Then Return $str
For $i = 0 To UBound($Temp) - 1
$Te = ChrW(Dec(StringReplace($Temp[$i], '\u', '')))
$unEncode = StringReplace($str, $Temp[$i], $Te, 1)
$str = $unEncode
Next
Return $unEncode
EndFunc