Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket Client to wss #117

Open
toJuanito opened this issue Nov 15, 2021 · 1 comment
Open

Websocket Client to wss #117

toJuanito opened this issue Nov 15, 2021 · 1 comment
Labels
type: support OT: Request for help using the project

Comments

@toJuanito
Copy link

toJuanito commented Nov 15, 2021

Hi, is it possible to communicate through wss protocol?
It works fine for me with ws.

#include <ArduinoJson.h>
#include <HttpClient.h>
#include <SoftwareSerial.h>
#include <Ethernet.h>
#include <WebSocketClient.h>

EthernetClient ethernet;

#include <ArduinoHttpClient.h>
byte mac[] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02};

char serverAddress[] = "wss://192.168.1.87";  //I dont know if it is possible, seems like not..
int port = 8010;

WebSocketClient client = WebSocketClient(ethernet, serverAddress, port);

Thanks in advance..

@toJuanito toJuanito changed the title Websockets with ssl Websocket Client to wss Nov 15, 2021
@per1234 per1234 added the type: support OT: Request for help using the project label Nov 21, 2021
@clysss
Copy link

clysss commented Feb 16, 2022

Perhaps I've not correctly understood the question...
with this following code, I connect with mqttServer="xxx.azurewebsites.net" on port 443... (wss)

WiFiClientSecure wifiClient;
WebSocketClient wsClient(wifiClient, mqttServer, 443);
WebSocketStreamClient wsStreamClient(wsClient, mqttPath);
PubSubClient MQTTClient(wsStreamClient);

you should have a look to
https://github.com/clysss/WebSocketStreamClient
and
#124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: support OT: Request for help using the project
Projects
None yet
Development

No branches or pull requests

3 participants