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

Defaults ws max_size on server to 16MB #538

Closed
wants to merge 131 commits into from

Conversation

euri10
Copy link
Member

@euri10 euri10 commented Dec 20, 2019

Rough attempt at solving #306

There are a few points I'm not sure:

  1. seems like this can be implemented only on WebSocketProtocol but the truth is I didn't find anything relevant for WSProtocol
  2. In class WebSocketCommonProtocol(asyncio.Protocol): the default max_size is 2**20 (1MB) so I wrote a new test that sends 1 more byte than this default, using a default config on the server side that uses a 16MB default (following hypercorn default), would you want to see more tests, which ones (send 1 bytes more that default config of 16MB > 1009 , anything else ?_)

@selimb selimb mentioned this pull request May 12, 2020
@tomchristie
Copy link
Member

Okay looks good. Shall we call this ws_max_size and make sure to push it all the way through to being a configurable setting? (Including the cli)

@euri10
Copy link
Member Author

euri10 commented May 14, 2020

Will do it asap, kind of swamped with work now.

@euri10
Copy link
Member Author

euri10 commented May 19, 2020

OK @tomchristie I changed the name and pushed it all the way up so that it's configurable,
there are 2 things I'd like feedback on before advancing:

  1. is the 16MB default good for you ?
  2. since the option is configurable only for the WebSocketProtocol (I didnt find anything relevant for the WSProtocol) should we add a warning / sys.exit(1) if someone uses the --ws-max-size with the --ws=wsproto ? I added a note in the docs in case

@euri10 euri10 requested a review from tomchristie May 19, 2020 18:17
euri10 and others added 15 commits May 19, 2020 20:19
Add '--app-dir' option to specify application directory when running uvicorn from any location
Closes encode#549
* 📝 Update changelog

* 🔖 Release version 0.11.6

* 👌 Update/simplify changelog
* 1st pass on adding windows vm for CI

* 2nd pass, was testing nothing

* No arrays

* No arrays 2

* No arrays 3

* No arrays 4

* Removed appveyor PATH export

* Using scripts on windows CI, will need to write ps1 scripts

* Matrix indent

* Location of scripts

* Hate CI

* Why ps1 are ignored

* Adding ps1 scripts, was globally ignored

* Chmod +x ps1

* Removing uvloop from win reqs

* Added install and test.sh scripts, globally ignored wtf

* Align win reqs to old .travis file

* Run really on windows ?

* Lost in matrix....

* Blind ps1

* Blind ps1 2nd pass

* Blind ps1 3rd pass

* Blind test.ps1 !

* Blind test.ps1 love

* Attempt specifying shell explicitely

* Try using bash on windows

* Detect os for requirements

* Use sh comparison

* Live debug

* Live debug 2

* More echo

* More echo

* More echo 2

* OSTYPE only in bash

* OSTYPE seems to be msys

* Using old names for scripts since we dont need to differentiate now between os

* Removed echo leftovers from live debugging and indented back to 4 spaces

* Correct set

* Removin=g unboud variable check

* Set -x before pip only

* Update install

* Set -e

Co-authored-by: Tom Christie <tom@tomchristie.com>
* Disallow invalid header characters

* Linting

* Fix escape sequence
* Quote path component before logging

* Linting
…code#636)

* Added AF_UNIX type socket to get client filled

* Removed travis debug

* Added travis verbose pytest for windows fail check

* Added travis verbose pytest for windows fail check

* No more tests output in travis now it's fixed on windows

* Useing a top level constant

* Lint
* Fix crash when --interface is wsgi

This is a regression introduced in
ae0fd31 (encode#597)

* Set asgi 3.0
pawamoy and others added 13 commits January 25, 2021 12:35
Nginx requires that we set the Connection/Upgrade headers explicitly in
the config, otherwise Nginx assumes that they shouldn't be forwarded.

More info: https://nginx.org/en/docs/http/websocket.html
* fix: pin uvloop to the lastest Python 3.6 supported version

* fix multiple python versions
Now that uvloop sets python_requires the pinning isn't needed, but we do need to
ignore the packages with missing python_requires

MagicStack/uvloop#401
* Fix wsgi middleware PATH_INFO encoding

* Add tests for wsgi PATH_INFO encoding
* v0.13.4

* v0.13.4

* Fixed commit

* Adapted with latest uvloop fix commit

* Adapted with latest uvloop fix commit

* Sneam wsgi fix
* Added test and implemented lifespan.shutdown.failed

* Move new test to bottom
* Up wsproto to 1.0.0

* We should test against both ws protocols

* Invalid upgrade in case of wsproto need ws version at least

* Removed paramtrized test for upgrade with websockets, but we should have one

* Removed leftovers

* Blacked

* Lint

* No need for that change

* No need for that change 2

* No need for that change 3

* No need for that change 4

* All you need is love

* Not changing that too

* Not changing that too 2

* Same upgrade request changed
* Note about ws not by default

* Add a warning message

* Removed index prose

* Add warning in h11 which is where you'll be with uvicorn installed without ws libraries

* Better warning message

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

* Seperate upgrade warning from libraries warning

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
@castaway2000
Copy link

I am also finding this to be a major hindrance in some of the work i am doing. is there a way we can merge this in?

@darthlegit
Copy link

eagerly awaiting this.

@aviramha aviramha mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet