Skip to content

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

@KhDenys

Description

@KhDenys

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions