Fix: make Competitive Companion listener robust on IPv4/IPv6 localhost#156
Fix: make Competitive Companion listener robust on IPv4/IPv6 localhost#156Pushpavel merged 3 commits intoPushpavel:mainfrom
Conversation
|
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
Pushpavel
left a comment
There was a problem hiding this comment.
Hi @znzryb, its ok if we bind to both interfaces on different ports (127.0.0.1:8000, ::1:9999). competitive companion is going to send request for both the ports anyway. With that, the code change should be pretty simple, our server should accept a InetAddress argument and we should run two servers.
- Improve request handling by reading the HTTP body without relying on EOF and returning a minimal 200 OK response to avoid hanging connections.
I don't understand the problem here. but if its really an issue, Its better we switch to an http server library like ktor than maintaining complicated parsing logic.
okay, I will delete these logics, It's not really an issue. |
okay, I already delete codes of http 200 "ok" code reply. Also, I test it, it can run in complex environment like below too. zzy@Mac ~ % lsof -nP -iTCP:27121 -sTCP:LISTEN
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Code\x20H 4074 zzy 50u IPv6 0x42979cd2fe18d20f 0t0 TCP *:27121 (LISTEN)
clion 7887 zzy 28u IPv6 0xff5097da8ac17a2a 0t0 TCP 127.0.0.1:27121 (LISTEN)
clion 7887 zzy 45u IPv6 0x53b624cd3bdddd1 0t0 TCP [::1]:27121 (LISTEN)
zzy@Mac ~ % |
|
Hi @znzryb, I've reviewed the changes again. I would prefer we go with the simpler approach:
This will be much easier to maintain than managing two raw sockets directly. There's no rush on this, so take your time, Let me know if you have any questions. |
|
Hey @znzryb, ignore the last comment, If it works that's all that matters. I will merge this. |
To fix #155.
Summary
localhostmay resolve to IPv6 (::1) first.http://localhost:<port>/are handled reliably.Test executed