Hypercorn is an ASGI and WSGI Server based on Hyper libraries and inspired by Gunicorn.
MIT License
1.18k
stars
105
forks
source link
Getting permission Error [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions when running FastAPI in IIS #231
I also tried to grant IIS_IUSRS access to python.exe but it didn't make any difference, it was suggested in this post as when calling the API it hangs forever
I suspect it's something to do with the IIS port binding, if I change the web.config to point at another port (e.g. 8080) different than the binding port in IIS then I'm able to access the API (e.g. by navigating to http://localhost:8080), it feels to me IIS is using the port when hypercorn is trying to use it
I have an issue that appears to be related to hypercorn as this does not happen with uvicorn
I'm trying to setup FastAPI in IIS using hypercorn and I keep getting the error
My web.config is the following
If I stop IIS and I run the command below it works fine, it's only when running it inside IIS.
I also tried to grant IIS_IUSRS access to python.exe but it didn't make any difference, it was suggested in this post as when calling the API it hangs forever
I suspect it's something to do with the IIS port binding, if I change the web.config to point at another port (e.g. 8080) different than the binding port in IIS then I'm able to access the API (e.g. by navigating to http://localhost:8080), it feels to me IIS is using the port when hypercorn is trying to use it
More info in here, my current workaround is to use uvicorn https://stackoverflow.com/questions/78471188/fastapi-running-in-iis-getting-permissionerrorwinerror-10013-an-attempt-was?noredirect=1#comment138365253_78471188