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

--http-websockets incompatible with --http-auto-gzip? #190

Closed
anthonyrisinger opened this issue Mar 24, 2013 · 6 comments
Closed

--http-websockets incompatible with --http-auto-gzip? #190

anthonyrisinger opened this issue Mar 24, 2013 · 6 comments

Comments

@anthonyrisinger
Copy link
Contributor

...after i enable --http-websockets, uWSGI will no longer set/send Content-Encoding: gzip on my XHR requests.

why must one set uWSGI-Encoding: gzip anyway? is there some problem i'm unaware of, or is this just to allow selective gzipping?

config:

http = 0.0.0.0:80
http-keepalive = 1
http-auto-chunked = 1
http-auto-gzip = 1
http-websockets = 1
add-header = uWSGI-Encoding: gzip
@unbit
Copy link
Owner

unbit commented Mar 24, 2013

add-header force the addition of the specified header to every request. You are basically forcing auto-gzip to every url. Auto-gzip remove the content-encoding header to avoid decoding error in the browser.

You may want to enable auto-gzip only to specific url, using internal routing. An example, enabling auto-gzip for all of the url not starting with /xhr

route-if-not = startswith:${PATH_INFO};/xhr addheader:uWSGI-Encoding: gzip

@anthonyrisinger
Copy link
Contributor Author

im not very familiar with websockets, but does that have a transfer encoding or sorts as well? or is websocket traffic compressed inherently/normally by default? i'm think i'm missing what you're trying to say.

i was thinking --http-auto-gzip was more of an opportunistic "gzip if client Accepts it and it makes sense" sort of thing, but from what you're saying it sounds like it's a little more of an explicit process, yes?

@unbit
Copy link
Owner

unbit commented Mar 25, 2013

websocket traffic (once the connection is established) bypass the whole HTTP logic. It is basically another protocol running on the same connection. Regarding auto-gzip, yes, it is an explicit process, the backend inform the http router that the content can be "gzipped" safely

@anthonyrisinger
Copy link
Contributor Author

ok cool cool, thanks for the info. AFAICT though, once --http-websockets is enabled, you can no longer --http-auto-gzip anything, which feels like we still have some kind of bug poking around in there.

@unbit
Copy link
Owner

unbit commented Aug 6, 2013

with the latest code i can confirm both works, can we close this ?

@anthonyrisinger
Copy link
Contributor Author

sure... i don't even recall what i was trying to do exactly, so your confirmation is as good as any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants