ArduinoWebsockets icon indicating copy to clipboard operation
ArduinoWebsockets copied to clipboard

Trouble connecting when passing query parameters

Open FeelDee opened this issue 5 years ago • 1 comments

I've been working with this library for a little while, and I really like the fact you can connect to any server using only the url. However, I've stumbled on a minor issue when passing query parameters. The url looks like this: ws://myserver.com?param=true (This url template works when working with node js, but not with ArduinoWebsockets)

I have looked into the code, and it seems like the connect function seeks for the first occurrence of / after the host name, which it doesn't find if you don't specify a path. Thus, I have found a workaround by just adding a / after the host name: ws://myserver.com/?param=true (This should work fine on any platform)

I have solved my problem, but I believe it would be nice if there was a patch correcting this little issue for everyone.

FeelDee avatar Jul 28 '20 23:07 FeelDee

That's a great post, because we just had that issue here https://github.com/gilmaimon/ArduinoWebsockets/issues/83

It's indeed a bad behavior by the library. Sadly I don't really have time to work on the library, test everything and so on.. I only invest the little time I have in fixing urgent bugs and merging pull requests. So I'm opening this issue for the public.

Gil.

gilmaimon avatar Aug 11 '20 18:08 gilmaimon