A3lx
A3lx
RRailway
Created by A3lx on 8/22/2023 in #✋|help
Hello everyone, i'm trying to make a python websocket using websockets library also flask
so basically i have this ->
async def main():
url = os.environ.get('RAILWAY_URL', 'localhost')
port = os.environ.get('RAILWAY_PORT')
print(f"WebSocket server is running at: wss://{url}:{port}")
asyncio.ensure_future(ping_pong())
asyncio.ensure_future(websockets.serve(handle_connection, "0.0.0.0", 4505))

app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 5000)))

asyncio.run(main())
async def main():
url = os.environ.get('RAILWAY_URL', 'localhost')
port = os.environ.get('RAILWAY_PORT')
print(f"WebSocket server is running at: wss://{url}:{port}")
asyncio.ensure_future(ping_pong())
asyncio.ensure_future(websockets.serve(handle_connection, "0.0.0.0", 4505))

app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 5000)))

asyncio.run(main())
functions functions etc.... when i go to my website hhr-bot-api.xyz i get the empty flask page but the thing is how do i connect to the websocket server? the railway terminal doesn't show anything out of common i used everything. wss://hhr-bot-api.xyz:4505 / ....... nothing looks to work.
19 replies