kingluo commented on issue #7481: URL: https://github.com/apache/apisix/issues/7481#issuecomment-1188557120
@xwc1125 What do you want to proxy? websockify could run in stand-alone mode. And it implements the standard websocket protocol, which is also supported by APISIX. That is, there are two choices to place APISIX: novnc ---(1)---> websockify ----(2)----> vncserver 1) if you put APISIX here, it proxy the websocket http connection between novnc and websockify. For example, you could use below admin API to define a route: ``` curl "http://127.0.0.1:9080/apisix/admin/routes/3" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d ' { "methods": ["GET"], "enable_websocket": true, "host": "localhost", "uri": "/ws/test", "upstream": { "type": "roundrobin", "nodes": { "localhost:8765": 1 } } }' ``` Here `localhost:8765` is the address of websockify. 2) tcp proxy In this case, the APISIX only proxy the tcp connection between websockify and vncserver. You could use below admin API to define a stream route: ``` curl http://127.0.0.1:9080/apisix/admin/stream_routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' { "remote_addr": "127.0.0.1", "upstream": { "nodes": { "127.0.0.1:65432": 1 }, "type": "roundrobin" } }' ``` Here `127.0.0.1:65432` is the address of your vncserver. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
