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

How to set host and port of a server? #4

Open
KhDenys opened this issue Jul 9, 2021 · 1 comment
Open

How to set host and port of a server? #4

KhDenys opened this issue Jul 9, 2021 · 1 comment
Labels
question Further information is requested

Comments

@KhDenys
Copy link

KhDenys commented Jul 9, 2021

I got an error if follow case:

async def main():
    global server
    runner = pyre.LSGIToASGIAdapter(app)
    server = pyre.Server(runner, listen_on='localhost:8080')
    server.ignite()
    await server.run_forever()

An example of an error:

pyre       |  INFO  pyre_server::server > binding to :
pyre       | Traceback (most recent call last):
pyre       |   File "test.py", line 34, in <module>
pyre       |     asyncio.run(main())
pyre       |   File "/usr/local/lib/python3.8/asyncio/runners.py", line 44, in run
pyre       |     return loop.run_until_complete(main)
pyre       |   File "uvloop/loop.pyx", line 1494, in uvloop.loop.Loop.run_until_complete
pyre       |   File "test.py", line 28, in main
pyre       |     server = pyre.Server(runner, listen_on='0.0.0.0:8080')
pyre       |   File "/code/pyre/pyre_http/shared.py", line 62, in __init__
pyre       |     self._server = create_server(
pyre       | OSError: invalid port value
@ChillFish8
Copy link
Contributor

pyre takes a list of addresses to bind to, e.g. listen_on=["127.0.0.1:7070", "127.0.0.1:9090"]

@ChillFish8 ChillFish8 added the question Further information is requested label Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants