I created an app with below global configuration:
<websocket:config name="WebSockets_Config" doc:name="WebSockets Config" doc:id="c252cefb-a74d-4f1c-a5f2-fd589ac692ed" >
<websocket:connection >
<websocket:server-settings listenerConfig="HTTP_Listener_config" idleSocketTimeout="60"/>
</websocket:connection>
</websocket:config>
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="d5e2b3f6-7485-474a-924d-71550194c0e7" basePath="/api">
<http:listener-connection host="0.0.0.0" port="${http.port}" />
</http:listener-config>
With http.port = 8081
However, on Cloudhud logs I see an error:
Connectivity test failed for config 'WebSockets_Config'. Application deployment will continue. Error was: Server on host 0.0.0.0 and port 8081 is stopped.
org.mule.runtime.api.connection.ConnectionException: Server stopped.
at com.mulesoft.connectors.ws.internal.connection.FluxCapacitorProvider.validate(FluxCapacitorProvider.java:167)
at com.mulesoft.connectors.ws.internal.connection.FluxCapacitorProvider.validate(FluxCapacitorProvider.java:60)
When I try to connect to it I get
Error during WebSocket handshake: Unexpected response code: 403
How can I fix this problem? I couldn't find the root problem.
That it works locally seems to indicate that the issue is infrastructure related. The URL that you are using doesn't go through a Dedicated Load Balancer as the documentation recommends to use the WebSockets connector in CloudHub 1.0. The documentation says to use port 8091 which is expected when using a Dedicated Load Balancer.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.