solace broker WSS connection issue
Comments
-
Can you tell us more. What's the error you see would be great for a start
0 -
hi @arih
I am trying to get connected to solace service via web socket broker url. But, after running the client, it is saying "connection cannot be established".0 -
I see, okay, so where is this client? Is this a web app that you create, or something provided like the Try-Me app in Solace web interface?
Might help if you show a screenshot too.
For now, I would think this is a connection issue, could be the URL is incorrect or the port is incorrect. Sometime the default/provided port might not be the one that is actually running.
0 -
@arih Thanks for the prompt response!
I am using a web app as client. Below is the url which I am using:
wss://mrnb5646to7em.messaging.solace.cloud:443And the complete properties is as below:
connectOptions = {
sBROKERURL: 'wss://mrnb5646to7em.messaging.solace.cloud:443',
sVPN: 'dman-solace-fundas',
sUSERNAME: 'solace-cloud-client',
sPASSWORD: '************',
sPublishTopic: 'solace/test/project/chat',
sSubscribeTopic: 'solace/test/project/chat',
sReceiveQueue: ''
}0 -
just to be clear, you are just connecting to the socket via JS or something like that without using one of the Solace APIs? This isn't going to work.
0 -
@arih it is enabled for web transport.
@amackenzie I am using Solace API
connect(oResultCallback) {//build the full URI to the broker. Makes for a more informational alert/debug message. var sFullURI = this.sUSERNAME + ":" + this.sPASSWORD + "@" + this.sBROKERURL + "/" + this.sVPN; console.debug("Establishing session to " + sFullURI); try { this.broker.session = solace.SolclientFactory.createSession({ // solace.SessionProperties url: this.sBROKERURL, vpnName: this.sVPN, userName: this.sUSERNAME, password: this.sPASSWORD }); } catch (error) { console.error(error.message); }
0 -
for sure some further info on the actual error message would be useful.
0 -
@amackenzie
Let me know if you need any further details.0 -
Sorry for the long image!!
0 -
@arih 👆 Please check
0 -
is there anything extra if you expand the ">" on the JS console?
0 -
other way to test is just clone this git repo here and open up the TopicPublisher sample https://github.com/SolaceSamples/solace-samples-javascript/
0 -
@arih Proxy is disabled, via curl it is getting connected
0 -
@amackenzie Please find the expanded console
0 -
@dhimanmayank said:
@arih Proxy is disabled, via curl it is getting connectedOkay, I assume you'll get something like "Empty reply from server" - which is good. Well that means you computer can connect, but your app cannot.
Can you try connecting to your broker using the sample javascript here instead of your own app? https://github.com/SolaceSamples/solace-samples-javascript just clone the whole thing, and create a lib folder inside with the solace JS API lib.
If the sample app can connect, then we might need to look more into your HTML and JS code too.
0