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

Cherrypy - Running natively in OS3 #147

Closed
jfmatth opened this issue Sep 22, 2016 · 5 comments
Closed

Cherrypy - Running natively in OS3 #147

jfmatth opened this issue Sep 22, 2016 · 5 comments
Assignees

Comments

@jfmatth
Copy link

jfmatth commented Sep 22, 2016

I have tried unsuccessfully to run CherrPy natively in OS3, as it's own server (i.e. no gunicorn or WSGI server).

Any help is appreciated

app.py

import cherrypy

class Root(object):
    @cherrypy.expose
    def index(self):
        return "Hello World!"
if __name__ == '__main__':
    from cherrypy._cpnative_server import CPHTTPServer
    cherrypy.server.httpserver = CPHTTPServer(cherrypy.server)
    cherrypy.server.socket_host = "0.0.0.0"
    cherrypy.quickstart(Root(), '/')

requirements.txt

cherrypy
@bparees
Copy link
Collaborator

bparees commented Sep 23, 2016

@GrahamDumpleton any experience here?

@hhorak
Copy link
Member

hhorak commented Sep 23, 2016

I think it will be caused by docker's handling sockets and cherrypy no happy about that way. Since when I exec into the container, it works:

# docker exec -ti `docker ps -q` bash
$> curl 127.0.0.1:8080
Hello World!

But on the host I also see:

curl: (56) Recv failure: Connection reset by peer

@hhorak
Copy link
Member

hhorak commented Sep 23, 2016

@GrahamDumpleton
Copy link
Contributor

Example at:

works fine.

It may be related to whatever:

    from cherrypy._cpnative_server import CPHTTPServer
    cherrypy.server.httpserver = CPHTTPServer(cherrypy.server)

is doing, which basic examples of using CherryPy do not use.

@jfmatth
Copy link
Author

jfmatth commented Sep 23, 2016

Ben, Graham and Honza,

Thank you for the quick response. I'll check this out today.

John

@jfmatth jfmatth closed this as completed Sep 23, 2016
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

4 participants