nginx-gateway-fabric icon indicating copy to clipboard operation
nginx-gateway-fabric copied to clipboard

Document websocket support

Open sjberman opened this issue 9 months ago • 3 comments
trafficstars

As an NGF user I want to know how to use NGF works with websocket applications So that I can run my websocket application fronted by NGF.

Acceptance

  • Write a brief document or paragraph on how to use websocket services with NGF
    • This really just involves the client setting the Upgrade: websocket header in a request.
    • Any additional websocket-specific headers can be specified in a header filter if necessary (like Sec-WebSocket-Key or Sec-WebSocket-Version

sjberman avatar Jan 29 '25 15:01 sjberman

An example default route this is of type Exact

    location = /query {
        

        

        proxy_http_version 1.1;
        proxy_set_header Host "$gw_api_compliant_host";
        proxy_set_header X-Forwarded-For "$proxy_add_x_forwarded_for";
        proxy_set_header Upgrade "$http_upgrade";
        proxy_set_header Connection "$connection_upgrade";
        proxy_set_header X-Real-IP "$remote_addr";
        proxy_set_header X-Forwarded-Proto "$scheme";
        proxy_set_header X-Forwarded-Host "$host";
        proxy_set_header X-Forwarded-Port "$server_port";
        proxy_pass http://blogs_blogs-be_80$request_uri;
            
            
            
    }

So websocket support is there by default

idc77 avatar Feb 02 '25 20:02 idc77

Yes, websockets are supported. We just want to make sure we document it so users are aware.

sjberman avatar Feb 03 '25 15:02 sjberman

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Feb 18 '25 02:02 github-actions[bot]