diff --git a/easywsclient.cpp b/easywsclient.cpp index 31ac572..b3b7591 100644 --- a/easywsclient.cpp +++ b/easywsclient.cpp @@ -265,6 +265,8 @@ WebSocket::pointer WebSocket::from_url(std::string url) { else if (sscanf(url.c_str(), "ws://%[^/]/%s", host, path) == 2) { port = 80; } + else if (sscanf(url.c_str(), "ws://%[^:]:%d", host, &port) == 2) { + } else { fprintf(stderr, "ERROR: Could not parse WebSocket url: %s\n", url.c_str()); return NULL;