Search the Community
Showing results for tags 'websockets'.
-
This is a continuation of this prior discussion. I have been trying to find a reliable way to interact with websockets using AutoIt, which will be a requirement for WebDriver BiDi. Unfortunately, I have yet to find a solution that is acceptable to me -- Initially I tried with @FireFox's code, which I modified / shared on Github. This worked fine until I realized that calls to _WinHttpWebSocketReceive wouldn't return until something was received. While researching, I found other instances where others ran into the same issue with the WinHttpWebSocketReceive function. Next I tried using iola, which is a command-line socket client with REST API. This worked ok, but was complicated by having to read the console output. Also, there wasn't any way to empty the queue of messages AFAICS. My current implementation uses websocat. Again, this works ok, but it lacks the ability to easily detect a failed websocket connection, etc. Alternatives to consider -- DotNet / CLR I found this C# code, but could never get it to run using AutoIt I found this VB.net code, but haven't tried to run it yet. Powershell - Found this code, but I haven't tried running yet Windows WebSocket Protocol Component API I'm sure that Chilkat would work, but I'm hoping for a FOSS solution <Insert your alternative here> Thanks for reading if you've made it this far. I am requesting input / suggestions on how we can obtain a reliable, working websocket implementation for AutoIt. Dan
-
Hello , I am trying to use Websockets in AutoIt. It is to fetch live stock market prices , API is provided and documentation available for python language. The link for the code snippet is : https://symphonyfintech.com/xts-market-data-front-end-api-v2/#tag/Introduction https://symphonyfintech.com/xts-market-data-front-end-api-v2/#tag/Instruments/paths/~1instruments~1subscription/post https://github.com/symphonyfintech/xts-pythonclient-api-sdk Second Link is to subscribe to a list of ExchangeInstruments. Now I would like to get live stock ltp (LastTradedPrice) for a few stocks whose "ExchangeInstrumentID" I know. I am able to use the WinHttp object to perform actions using simple codes like below : I have the secretKey and appkey and can generate the needed token. And get the unique ExchangeInstrumentID. Below code is just for example of how I am using WinHttp. Unrelated to socket part. Global $InteractiveAPItoken = IniRead(@ScriptDir & "\Config.ini", "token", "InteractiveAPItoken", "NA") $baseurl = "https://brokerlink.com/interactive/" $functionurl = "orders" $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", $baseurl & $functionurl, False) $oHTTP.SetRequestHeader("Content-Type", "application/json;charset=UTF-8") $oHTTP.SetRequestHeader("authorization", $InteractiveAPItoken) $pD = '{ "exchangeSegment": "NSEFO", "exchangeInstrumentID": ' & $exchangeInstrumentID & ', "productType": "' & $producttype & '", "orderType": "MARKET", "orderSide": "' & $orderside & '", "timeInForce": "DAY", "disclosedQuantity": 0, "orderQuantity": ' & $qty & ', "limitPrice": 0, "stopPrice": 0, "orderUniqueIdentifier": "' & $orderidentifier & '"}' $oHTTP.Send($pD) $oReceived = $oHTTP.ResponseText $oStatusCode = $oHTTP.Status But am struggling to understand and use socket. Would be of great help if you can have a look at the link mentioned above and help with the code sample for AutoIt. To connect and listen to a socket. Thanks a lot
- 2 replies
-
- websockets
- winhttprequest
-
(and 2 more)
Tagged with:
-
Has anyone already worked on a WSS UDF yet? I'm interested in making a project involving WSS with the ASYNC autoit library like ratchetphp / Pawl in PHP. (using reactphp) ASYNC is a must, and obviously WSS. the problem with some libraries i've worked with in PHP are mainly issues with handshakes like improper peer name validation (for multi level certs) relevant links: https://tools.ietf.org/rfc/rfc6455.txt https://github.com/ratchetphp/Pawl /e i should note i'm not looking for hybrid workarounds, i want to do this in autoit alone. (no javascript)
-
- wss
- websockets
-
(and 3 more)
Tagged with: