Using WebSockets and Ambassador
Ambassador makes it easy to access your services from outside your application, and this includes services that use WebSockets. Only a small amount of additional configuration is required, which is as simple as telling the Mapping to allow "upgrading" from the HTTP protocol to the "websocket" protocol:
allow_upgrade:- websocket
Example WebSocket Service
The example configuration below demonstrates the addition of the use_websocket
attribute.
---apiVersion: getambassador.io/v2kind: Mappingmetadata:name: my-service-mappingspec:prefix: /my-service/service: my-serviceallow_upgrade:- websocket---kind: ServiceapiVersion: v1metadata:name: my-servicespec:selector:app: MyAppports:- protocol: TCPport: 80targetPort: 9376
Questions?
We’re here to help. If you have questions, join our Slack or contact us.