Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to proxy websocket with kong ingress #995

Closed
w564791 opened this issue Dec 30, 2020 · 10 comments
Closed

how to proxy websocket with kong ingress #995

w564791 opened this issue Dec 30, 2020 · 10 comments
Assignees
Labels
pending author feedback question Further information is requested

Comments

@w564791
Copy link

w564791 commented Dec 30, 2020

likes use nginx:

proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";

what should i do

@rainest rainest self-assigned this Jan 5, 2021
@rainest
Copy link
Contributor

rainest commented Jan 5, 2021

Did you encounter any issues when trying to do this? WebSocket proxying is supported by default and doesn't require any special configuration: if you send a WebSocket Upgrade request from your client to any route, we'll proxy it upstream, return the upstream 101 response, and continue proxying the WebSocket traffic after.

@w564791
Copy link
Author

w564791 commented Jan 5, 2021 via email

@rainest
Copy link
Contributor

rainest commented Jan 8, 2021

Can you show an example of what you're seeing? Sending an initial https://-scheme request with an Upgrade header should be fine.

@mflendrich mflendrich added pending author feedback question Further information is requested labels Jan 14, 2021
@rainest
Copy link
Contributor

rainest commented Feb 23, 2021

Closing this due to inactivity. Feel free to respond back and we can reopen this if needed.

@rainest rainest closed this as completed Feb 23, 2021
@priyanka-raghavan-maersk

Hi do you have an example of how you got it work?

@priyankaraghavan
Copy link

It is working now unauthenticated.

@Gowtham029
Copy link

@priyankaraghavan do you have an example of how you got it work.

@priyanka-raghavan-maersk
Copy link

priyanka-raghavan-maersk commented Apr 20, 2022

Yes you can pass in your access token as a query param

wss://gateway-url/route-path/notification/notificationHub?access_token=<access_token>

Actually i did not have to do anything special with kong to make it work

@myvodx
Copy link

myvodx commented Jul 12, 2023

We need to update the ingress annotations as bellow.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  # ... other properties
  annotations:
    konghq.com/headers.Connection: "Upgrade"
    konghq.com/headers.Upgrade: "WebSocket"
   ...

See more information:

@aleksandarsavev
Copy link

Is there a full example of an Ingress configuration. I always receive 200 OK and it cannot continue the websocket handshake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending author feedback question Further information is requested
Projects
None yet
Development

No branches or pull requests

8 participants