lua-resty-http
lua-resty-http copied to clipboard
[Feat] Support ws and wss scheme in http_connect.lua
This all looks good to me, but I'm not sure I understand the use case? How does this make sense as compared to say, the client in lua-resty-websocket?
Can you think of any useful tests we might add?
@pintsized I'll add tests, no problem. We use your library as a proxy server, in which case we want to send any HTTP request the customer sends - even the initial HTTP(S) request to a WebSocket server. In our code we then check if the response contains the Upgrade header and the HTTP 101 status. If it does - we take the inner socket and work directly with it. But we still use your library as a generic way to send the first HTTP request :) If it makes sense - I'll write some tests and commit.
@GuyLewin Ah ok, got it, thanks. Sounds good to me.
@pintsized added tests, also added support for 'ws' and 'wss' scheme in parse_uri
(which I think is important because users would probably parse_uri()
before they connect()
)