onyxframework / onyx

Powerful framework for modern applications 💪
https://api.onyxframework.com/onyx
MIT License
78 stars 5 forks source link

Default hostname on Mac #12

Closed vladfaust closed 5 years ago

vladfaust commented 5 years ago
> [13:33PM] onyx-example$ PORT=5001 REDIS_URL=redis://localhost:6379 crystal app.cr
 INFO [13:33:13.341 #95829] ⬛ Onyx::HTTP::Server is listening at http://[::1]:5001
> [13:34PM] onyx-example$ wscat --connect ws://localhost:5001?name=Jeremy
error: connect ECONNREFUSED 127.0.0.1:5001
> [13:34PM] onyx-example$ wscat --connect ws://127.0.0.1:5001?name=Jeremy
error: connect ECONNREFUSED 127.0.0.1:5001
> [13:34PM] onyx-example$ wscat --connect ws://0.0.0.0:5001?name=Jeremy
error: connect ECONNREFUSED 0.0.0.0:5001
> [13:35PM] onyx-example$ wscat --connect ws://[::1]:5001?name=Jeremy
connected (press CTRL+C to quit)

It binds to "[::1]" on MacOS. "0.0.0.0" works fine though. Not sure if I shoudl change the default hostname to "0.0.0.0".

"127.0.0.1" works as well.

vladfaust commented 5 years ago

Closed by 3a98a1a15557c9fe671e0c605146298db168a5cf.