ArduinoWebsockets
ArduinoWebsockets copied to clipboard
Trouble connecting when passing query parameters
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.
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.