warmcat / libwebsockets

canonical libwebsockets.org networking library
https://libwebsockets.org
Other
4.69k stars 1.47k forks source link

Question regarding sending authentication data. #652

Closed sjames1958gm closed 7 years ago

sjames1958gm commented 7 years ago

I am trying to use libwebsocket as a client to connection to the watson speech to test service. The service either requires a authentication token in the URL or username / password in json. How can I do either with libwebsocket? http://www.ibm.com/watson/developercloud/speech-to-text/api/v1/

lws-team commented 7 years ago

When you create the client connection using struct lws_client_connect_info, there is a member .path that lets you set the path part of the URL that is used to connect to the server. You can put the auth token in there using a path like speech-to-text/api/v1/recognize?watson-token=abc.

sjames1958gm commented 7 years ago

Thanks.