---
schema_version: "1"
id: e743dbfd1ee187c8eacf02c9be4ccc73b9c7e95869f840d2ea17126609bc090a
title: WebSockets Connector in CloudHub
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/websockets-connector/latest/websockets-connector-cloudhub.md
canonical_url: https://docs.mulesoft.com/websockets-connector/latest/websockets-connector-cloudhub
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 1b2ce5baf4358002ab740a6831716ad2e1c3d9ad6ab86efb014832cf674f0c53
description: MuleSoft Documentation Site
release: "1.0"
latest: true
---
---
product: WebSockets Connector
version: 1.0
is-latest-version: true
---

# WebSockets Connector in CloudHub

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

You can deploy Mule apps that contain inbound WebSockets endpoints, outbound WebSockets endpoints,
or both to CloudHub.

If your app has inbound WebSockets endpoints only, to deploy the app in CloudHub you must:

1.  Configure an Anypoint Virtual Private Cloud (VPC).

2.  Set up a dedicated load balancer to route WS and WSS traffic through the Mule app.

To set up the inbound WebSocket endpoints:

1.  Configure the WebSockets inbound listener (`<ws:inbound-listener>`) to listen on one of the
    following ports:

    - `0.0.0.0`.

    - To communicate over WS, set the listener port to `8091`.

    - To communicate over WSS, set the listener port to `8092`.

2.  Deploy your app to the VPC.

3.  Set up the dedicated load balancer’s URL mapping rules to associate a URI to a specific app.

    For example, if your app is named 'my-websockets-mule-app', you can define a rule like the
    following:

    - Input Path: `/my-websockets-mule-app/`

    - Target App: `my-websockets-mule-app`

    - Output Path: `/`

    - Protocol: `ws`

This rule routes all requests made to your dedicated load balancer’s URL and the specified input
path to your Mule app’s root path `/`. The load balancer’s name determines its assigned URL, so for
this example, if you name your load balancer `mylb`, then you would need to browse to:
`ws://mylb.lb.anypointdns.net:80/my-websockets-mule-app/` to connect to your WebSockets Listener.

The dedicated load balancer forwards all requests issued to port 80 to your app’s port 8091, which
is destined for all WS connections. When using WSS, however, issue your requests to port 443, and
these requests are forwarded to your Mule app’s port 8092.

> [!NOTE] For CloudHub 2.0 deployments, a Mule app that supports websockets is deployed in the same
> manner as any other Mule app deployed to CloudHub 2.0. For details, refer to
> [Deploying Apps to CloudHub 2.0](https://docs.mulesoft.com/cloudhub-2/ch2-deploy).

## See Also

- [Salesforce Help](https://help.salesforce.com)

- [VPC Network Architecture](https://docs.mulesoft.com/cloudhub/vpc-architecture-concept)

- [Dedicated Load Balancer Architecture](https://docs.mulesoft.com/cloudhub/lb-architecture)

- [Dedicated Load Balancer Mapping Rules](https://docs.mulesoft.com/cloudhub/lb-mapping-rules)
