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

Add ServerAdapter (fix CherryPy ServerAdapter) #932

Closed
wants to merge 3 commits into from
Closed

Add ServerAdapter (fix CherryPy ServerAdapter) #932

wants to merge 3 commits into from

Conversation

06180339
Copy link
Contributor

@06180339 06180339 commented Jan 28, 2017

Since CherryPy >= 9, the server part of CherryPy has been extracted and named Cheroot. Thus the old CherryPy ServerAdapter does not work for CherryPy >= 9: The import fails, and the SSL part should be different too. Cheroot can be installed (pip install cheroot) without CherryPy so that we can have a CherootServer adapter in addition to the CherryPyServer adapter for the older versions. I have used this class (just inheriting from bottle.ServerAdapter) and it worked for SSL and non-SSL.

(Edit:) To be clear: The proposed CherootServer adapter is foremost a fix of the CherryPyServer Adapter for the latest versions of CherryPy: When I pip install cherrypy, the cheroot server is installed along with cherrypy, and the imports are working as given in the proposed Adapter (as well as the SSL part). So one could also replace the body of the CherryPyServer adapter with the body of the proposed adapter, calling this adapter either still "CherryPyServer" or "CherootServer".
(Edit 2): Cp. http://docs.cherrypy.org/en/latest/history.html

Since CherryPy >= 9, the server part of CherryPy has been extracted and named Cheroot. Thus the old CherryPy ServerAdapter does not work for CherryPy >= 9: the import fails, and the SSL part should be different too. Cheroot can be installed (git install cheroot) without CherryPy so that we can just have a CherootServer adapter in addition to the CherryPyServer adapter for the older versions.
Add ServerAdapter for CherryPy >= 9
@06180339 06180339 changed the title Add ServerAdapter Add ServerAdapter (fix CherryPy ServerAdapter) Feb 12, 2017
@defnull defnull closed this in be90814 Mar 25, 2017
@xiaohuazi123
Copy link

Since CherryPy >= 9, the server part of CherryPy has been extracted and named Cheroot. Thus the old CherryPy ServerAdapter does not work for CherryPy >= 9: The import fails, and the SSL part should be different too. Cheroot can be installed (pip install cheroot) without CherryPy so that we can have a CherootServer adapter in addition to the CherryPyServer adapter for the older versions. I have used this class (just inheriting from bottle.ServerAdapter) and it worked for SSL and non-SSL.

(Edit:) To be clear: The proposed CherootServer adapter is foremost a fix of the CherryPyServer Adapter for the latest versions of CherryPy: When I pip install cherrypy, the cheroot server is installed along with cherrypy, and the imports are working as given in the proposed Adapter (as well as the SSL part). So one could also replace the body of the CherryPyServer adapter with the body of the proposed adapter, calling this adapter either still "CherryPyServer" or "CherootServer".
(Edit 2): Cp. http://docs.cherrypy.org/en/latest/history.html

Can you provide the CherootServer code here?

juergh pushed a commit to juergh/bottle that referenced this pull request May 24, 2022
If you are using this adapter, simply switch to 'cheroot'
This should fix some recent and some very old issues regarding cherrypy:

fix bottlepy#947 Leave explicit the maxima version supported the CherryPy (<= 9.0.0)
fix bottlepy#932 Add ServerAdapter (fix CherryPy ServerAdapter)
fix bottlepy#685 Update CherryPy SSL to use latest API and work on Py3
fix bottlepy#574 Allow custom bind_addr for CherryPy

(backported from commit be90814)
[juergh: Adjust context, drop modifications of test/travis-requirements.txt
 which does not exist in 0.12.]
Signed-off-by: Juerg Haefliger <juergh@protonmail.com>
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

Successfully merging this pull request may close these issues.

2 participants