Skip to content

Fixes / Improvements #2

@Danp2

Description

@Danp2

I'm getting this assertion when I attempt to connect to the websocket

It appear to be due to this section of code --

WebSocketAsio/library.cpp

Lines 328 to 338 in e90faa3

static boost::wregex const s_pat(LR"(^wss?://([\w\.]+):(\d+)(.*)$)");
boost::wsmatch matches;
if (!boost::regex_match(std::wstring(szServer), matches, s_pat)) {
COUT(L"Failed to parse host & port. Correct example: ws://localhost:8080/");
return 0;
}
std::wstring path(boost::trim_copy(matches[3].str()));
if (path.empty())
path = L"/";

@sehe I've tried fixing this on my own, but I've been unsuccessful. I would appreciate some guidance.

A few related questions --

  • Should boost::regex_match be changed to boost::regex_search?
  • Is there a strong reason to not use boost::urls instead of regex?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions