Connect to a WebSocket server using AutoHotkey by taking advantage of a hidden ActiveX control.
Note that it does not garbage collect until disconnected.
Usage
Code: Select all
#NoEnv
SetBatchLines, -1
#Include ../WebSocket.ahk
new Example("wss://echo.websocket.org/")
return
class Example extends WebSocket
{
OnOpen(Event)
{
InputBox, Data, WebSocket, Enter some text to send through the websocket.
this.WebSock.Send(Data)
}
OnMessage(Event)
{
MsgBox, % "Received Data: " Event.data
this.Close()
}
OnClose(Event)
{
MsgBox, Websocket Closed
this.Disconnect()
}
OnError(Event)
{
MsgBox, Websocket Error
}
__Delete()
{
MsgBox, Exiting
ExitApp
}
}
Related Projects
Download