-
Notifications
You must be signed in to change notification settings - Fork 170
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
Websocket support. #1152
Websocket support. #1152
Conversation
d515851
to
0dfde01
Compare
t/apicast-policy-websocket.t
Outdated
use lib 't'; | ||
use Test::APIcast::Blackbox 'no_plan'; | ||
|
||
repeat_each(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to run them twice?
t/apicast-policy-websocket.t
Outdated
[error] | ||
|
||
|
||
=== TEST 2: Simple Websocket connection pass through |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests numbers are wrong starting from this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, isn't this test checking the same as TEST 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's usingg ws
url.
[error] | ||
|
||
|
||
=== TEST 2: No websocket connection with policy does not change Upgrade header |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this test is duplicated.
|
||
function _M:rewrite() | ||
if is_websocket_connection() then | ||
ngx.var.upstream_connection_header = "Upgrade" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the caller responsible for setting this header?
https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism#Upgrading_to_a_WebSocket_connection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's reset on apicast.conf and this is to make sure that we set to Upgrade.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but why is this header not set by the application that calls apicast?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is set, but is overwritten by default here:
https://github.com/3scale/APIcast/blob/master/gateway/conf.d/apicast.conf#L88
So, the changes allow only to change that, just because is a websocket server.
This commit adds the option to enable Websocket pass trough to the upstream API if the original connection is a websocket connection. Fix THREESCALE-4019 Signed-off-by: Eloy Coto <[email protected]>
This commit add support to add wss protocol in the api_backend definition, so users can define it easily. Signed-off-by: Eloy Coto <[email protected]>
This commit adds the option to enable Websocket pass trough to the
upstream API if the original connection is a websocket connection.
Signed-off-by: Eloy Coto [email protected]