This Sample is aim to get websocket address from another server and dynamic forward websocket connection.
Application Name | Purpose |
---|---|
websocket-service-1 | First websocket service |
websocket-service-2 | Second websocket service |
address-lookup-service | To get dynamic connection info |
forward-gateway | To dynamic forward websocket connection |
-
- Run websocket-service-1
-
- Run websocket-service-2
-
- Run address-lookup-service
-
- Run forward-gateway
-
- Connect websocket with
ws://127.0.0.0:9011/websocket/type1
,Then Connect Successful
- Connect websocket with
-
- Send some message,you'll receive an echo response
-
- Change
type1
totype2
,you'll connect to the websocket-service-2
- Change