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 config kong ingress controller for proxy websoket request #802

Closed
swift1911 opened this issue Aug 14, 2020 · 9 comments
Closed

How to config kong ingress controller for proxy websoket request #802

swift1911 opened this issue Aug 14, 2020 · 9 comments
Labels
needs-triage question Further information is requested stale Will be closed unless advocated for within 7 days

Comments

@swift1911
Copy link

Summary

SUMMARY_GOES_HERE

Kong Ingress controller version
0.9.1

Kubernetes version

Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.1", GitCommit:"eec55b9ba98609a46fee712359c7b5b365bdd920", GitTreeState:"clean", BuildDate:"2018-12-13T10:39:04Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.10", GitCommit:"7a578febe155a7366767abce40d8a16795a96371", GitTreeState:"clean", BuildDate:"2019-05-01T04:05:01Z", GoVersion:"go1.10.8", Compiler:"gc", Platform:"linux/amd64"}
paste kubectl version output

What happened

I want to use kong to proxy websocket request to my backend service.But i don't find the solution from the document.The following is my config of Ingresss.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: websocket-ingress
spec:
  rules:
  - host: xxx.xxx.org
    http:
      paths:
      - backend:
          serviceName: websocket
          servicePort: 8080
        path: /

But it's error for testing 'error: Unexpected server response: 101' , it seem that the header 'Connection: Upgrade' my not be applied to the proxy.
Is there any solution for websocket?

@swift1911 swift1911 changed the title How to config kong ingress controller proxy websoket request How to config kong ingress controller for proxy websoket request Aug 14, 2020
@hbagdi
Copy link
Member

hbagdi commented Aug 18, 2020

What is the version of Kong?

error: Unexpected server response: 101

And where do you get this error from?

@swift1911
Copy link
Author

swift1911 commented Aug 19, 2020

What is the version of Kong?
Kong community 2.1.2

error: Unexpected server response: 101

And where do you get this error from?
I have used wscat tool https://www.npmjs.com/package/wscat to make connection to the server

@hbagdi
Copy link
Member

hbagdi commented Aug 19, 2020

@gszr Any idea?

@phamquyhai
Copy link

Same me,
I need add a config to support web socket, but not found :(
nginx.conf

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

@hbagdi
Copy link
Member

hbagdi commented Sep 11, 2020

ping @bungle @gszr

@hbagdi hbagdi added needs-triage question Further information is requested labels Sep 11, 2020
@fuhrmannd
Copy link

Is there any update or solution here? I am struggling with the same problem :(
Help would be really appreciated! @hbagdi @phamquyhai @bungle @gszr
Best regards,
Daniel

@w564791
Copy link

w564791 commented Dec 29, 2020

Same me,
I need add a config to support web socket, but not found :(
nginx.conf

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

me too

@stale
Copy link

stale bot commented Mar 20, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Will be closed unless advocated for within 7 days label Mar 20, 2021
@stale stale bot closed this as completed Mar 27, 2021
@myvodx
Copy link

myvodx commented Jul 12, 2023

It's related #995

It works for me. Just 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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage question Further information is requested stale Will be closed unless advocated for within 7 days
Projects
None yet
Development

No branches or pull requests

6 participants