Hello IBM Community,
I am trying to connect a WebSocket running on my server to IBM API Connect using the websocket-upgrade
policy, but I'm unable to establish the connection.
My Setup:
APIC Proxy Configuration:
-
Using DataPower API Gateway
-
Added websocket-upgrade
policy in the assembly
-
target-url
property set to: wss://<my-server-ip>:8000/ws
-
Schemes include both wss
and https
Configuration :
swagger: '2.0'
info:
title: ws
x-ibm-name: ws
version: 1.0.0
x-ibm-configuration:
cors:
enabled: false
gateway: datapower-api-gateway
type: rest
phase: realized
enforced: true
testable: true
assembly:
execute:
- websocket-upgrade:
request-assembly:
execute: []
catch:
- execute: []
otherwise: []
response-assembly:
execute: []
catch:
- execute: []
otherwise: []
header-control:
type: blocklist
values: []
parameter-control:
type: allowlist
values: []
version: 2.0.0
title: websocket-upgrade
timeout: 60
target-url: $(target-url)
inject-proxy-headers: true
properties:
target-url:
description: The URL of the target service
encoded: false
value: wss://<my-server-ip>:8000/ws
activity-log:
enabled: true
success-content: activity
error-content: payload
basePath: /ws
paths:
/data:
get:
responses:
'200':
description: success
schema:
type: string
schemes:
- wss
- https
Issue:
When I try to establish the WebSocket connection from the APIC proxy, the connection fails (even though a direct connection to the FastAPI endpoint works fine).
Question:
-
Is there any additional configuration required in APIC to successfully connect to a self‑hosted WebSocket endpoint?
-
Do I need any special TLS or network configuration to allow the APIC gateway to connect to my local/private server IP?
Any guidance, configuration example, or troubleshooting steps will be greatly appreciated.
------------------------------
Mounika Nayikoti
------------------------------