hypercorn icon indicating copy to clipboard operation
hypercorn copied to clipboard

application_path is ignored

Open nrcionline opened this issue 1 year ago • 4 comments

How is it possible to start hypercorn in a directory without the application?

I tried adding "application_path" to my config.py file, but it is ignored. The command can't find the app.

nrcionline avatar Aug 04 '23 14:08 nrcionline

I am working around this by using Hypercorn programmatically via the serve - it works great from the command line. However, I've had no luck using httpPlatformHandler. Does anyone know how to get this to work for IIS? Here is the section of the web.config file:

        <handlers>
            <add name="HypercornHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" requireAccess="Script" />
        </handlers>
        <httpPlatform processPath="C:\<path>\python.exe" arguments="C:\<path>\server.py">
        </httpPlatform>

If I run C:<path>\python.exe C:<path>\server.py from the command line, it works. But through IIS - nothing happens. I have made sure I have httpPlatformHandler installed and restarted IIS - but still nothing.

nrcionline avatar Aug 04 '23 21:08 nrcionline

I made a little more progress. I can see hypercorn is running. I can browse to the localhost:port from the server (and it is working as expected), but when I access the domain name, the app comes up, but there is no websocket connection. It would appear that httpPlatformHandler does not pass through the websocket ? Although I thought I read somewhere that this was the whole point. Maybe I am missing something? I'd like this to work, but it's not looking good.

nrcionline avatar Aug 05 '23 01:08 nrcionline

I've tried this several different ways. Using reverse proxy instead of httpplatformhandler yields the same results as far as I can tell. The only difference is I start hypercorn from the command line and this allows me to see some debug info. When I connect directly (localhost:port) it works. When I try via a domain that is rewritten to localhost:port, it runs, makes a connection, but never sends anything and disconnects.

Do you have any idea how to get this to work either with the httpplatform or a reverse proxy? Both of these seem to fail to pass through the requests from port 80 to the localhost:port.

nrcionline avatar Aug 05 '23 04:08 nrcionline

I've no experience with httpPlatformHandler nor IIS so I can't help you. I'll leave this open for a while longer in case someone else can.

pgjones avatar Oct 28 '23 21:10 pgjones