WSS connection is not getting established for solace. Neither with/out corporate vpn.
Can you tell us more. What’s the error you see would be great for a start
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”.
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.
@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:443
And 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: ‘’
}
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.
Could you check if the secured web transport is in fact enabled in the MessageVPN? It should looks like this:
@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);
}
for sure some further info on the actual error message would be useful.
@amackenzie
Let me know if you need any further details.
Sorry for the long image!!
@arih ? Please check
is there anything extra if you expand the “>” on the JS console?
it could still be a connection issue I think. Are you using a proxy for http?
could you do this below and see what happens from terminal?
curl -vvv https://mrnb5646to7em.messaging.solace.cloud:443
other way to test is just clone this git repo here and open up the TopicPublisher sample GitHub - SolaceSamples/solace-samples-javascript: Getting Started Samples for the Solace JavaScript API.
@arih Proxy is disabled, via curl it is getting connected
@amackenzie Please find the expanded console
Okay, 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? GitHub - SolaceSamples/solace-samples-javascript: Getting Started Samples for the Solace JavaScript API. 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.
@dhimanmayank , were you able to solve this problem? We are experiencing the same problem and your inputs would be of great help. thx