Hi 

your code
Set WebSoc=##class(%Net.WebSocket.Client).%New(WebSocURL,cre,evl)   
Just uses the Default %Net.HTTPrequest that contains url port, ....
But %New offers more
• Methode %OnNew(pURL As %String, pCredentials As %Net.WebSocket.ICredentials = $$$NULLOREF, pEventListener As %Net.WebSocket.IEventListener = $$$NULLOREF, pAcceptedProtocols As %String = "", pRequest As %Net.HttpRequest = $$$NULLOREF) als %Status
and in %Net.HTTPrequest you have a property port
https://docs.intersystems.com/iris20251/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&PRIVATE=1&CLASSNAME=%25Net.HttpRequest
I never needed it as protocol ws and wss was sufficient.
But there is no other place for a port to be assigned


 

In short: 

  • Index ZipIDX On (City,State)  sorts by 2 levels City and State and holds a pointer to the  referred record
  • Index ZipIDX On ZipCode [ Data = (City,State) ] sorts just by ZipCode and holds a pointer to the  referred record but also a copy of City and State This is faster if all you want is to map ZIP to City, State and have no need to access what else is in your record

Assuming you have full access to your Windows you may take this approach.

  • install TCPTRACE as a local forward
  • it shows you what it gets from Caché
  • and passes it along to your target system
  • you can be sure it knows the network mechanics
  • if you see your text, but no reply you most likely
  • are a victim of Windows firewalls
    • OUTGOING on your end,
    • INCOMING at the target system
    • OUTGOING for the target reply
    • INCOMING from the target on your side
  • So in the worst case, you need 4 explicit rules ! 
  • Adding TCPTRACE on the target system also improves insight on the other end

You are right,  The example defines 
Class WSCI.CRE Extends (%RegisteredObject, %Net.WebSocket.ICredentials)
but doesn't use it,

According to the class definition of 
%Net.WebSocket.Client you pass it as a parameter
in the %New() method.

 so you code (extending my example may look like this:

 	set cre=##class(WSCI.CRE).%New()
#; feed whatever your credentials need 	
#; init connection 	
 	set ws=##class(%Net.WebSocket.Client).%New(url,cre,evl)

It might be worth checking what class %Net.WebSocket.Client does with your credentials