Skip to content

IPv6 bracketed address not functional when used on client side Linux/macOS#571

Open
cosminpolifronie wants to merge 4 commits intomachinezone:masterfrom
cosminpolifronie:master
Open

IPv6 bracketed address not functional when used on client side Linux/macOS#571
cosminpolifronie wants to merge 4 commits intomachinezone:masterfrom
cosminpolifronie:master

Conversation

@cosminpolifronie
Copy link
Copy Markdown

@cosminpolifronie cosminpolifronie commented Apr 18, 2026

Hello! In a project at work we are running into trouble using IXWebSocket with bracketed IPv6 addresses, specifically [::1]:1234, and specifically on Linux. Windows worked fine, somehow.

This pull request fixes 2 issues:

  1. Bracketed IPv6 addresses not being properly parsed by clParseURL::ParseURL (commit 1)
  2. Even after proper parsing, client was not able to connect to server on Linux/macOS because of RFC 7230 violation (brackets are required in Host and Origin headers) (commit 2)

These issues have been manually debugged and fixed at first. I wasn't a fan of the clParseURL::ParseURL readability, and my manual fix for the second issue became a bit too complex for comfort in a codebase I'm not familiar with.

As such, I wanted to see how Copilot would handle this + refactoring the clParseURL::ParseURL logic and error handling.

This isn't AI slop. All the changes were human reviewed every step of the way and edge case handling was insisted on (I did find some that Copilot didn't handle). Also, tests were introduced for all the modified behavior.

All tests are passing on macOS. They have been also run with fixes disabled, and expectedly failed.

TL;DR: the code and tests are Copilot written but have been human prompted and reviewed. Initial investigation and fix was done 100% manually.
TODO: check the implementation on Linux and Windows (checked only macOS for now), and in our specific project (will come back on Monday with results)

Great project, by the way. This library is a breeze to use compared to Boost.Beast. Your work is much appreciated!

@cosminpolifronie
Copy link
Copy Markdown
Author

cosminpolifronie commented Apr 18, 2026

@bsergean Hi! Would you happen to have some time for review, approval and a release? We would like to use this modified code in production as a conan2 package. I will handle the update of the package there after release.

Also, if you consider the refactor in commit 3 too large or too big of a change, the first 2 commits alone are solving the blocker issue I had with the library. Commit 3 fixes some RFC rules that weren't handled by the previous algorithm.

@cosminpolifronie
Copy link
Copy Markdown
Author

cosminpolifronie commented Apr 18, 2026

Windows tests were crashing when running on IPv6. There was an old FIXME left in there warning about that code possibly crashing on IPv6. Fixed in last commit. Windows build and tests are now passing.

@cosminpolifronie
Copy link
Copy Markdown
Author

Can confirm that builds and tests are passing after last commit on all OSes: Windows, Linux (gcc and clang) and macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant