Skip to content

Commit 7d4c7cf

Browse files
author
Max Weller
committed
add support for other ports than 443
1 parent 80ff45c commit 7d4c7cf

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

default-rom/notification_db.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ void pullNotifications() {
1717
Serial.println(channelIterator.filename(""));
1818

1919
String host = channelIterator.host();
20+
int port = 443;
21+
int portidx = host.indexOf(":");
22+
if (portidx != -1 ) {
23+
port = host.substring(portidx+1).toInt();
24+
host=host.substring(0,portidx);
25+
}
2026
String url = channelIterator.url();
2127
String fingerprint = channelIterator.fingerprint();
2228

@@ -25,8 +31,10 @@ void pullNotifications() {
2531

2632
WiFiClientSecure client;
2733
Serial.print("connecting to ");
28-
Serial.println(host);
29-
if (!client.connect(host.c_str(), 443)) {
34+
Serial.print(host);
35+
Serial.print(" port ");
36+
Serial.println(port);
37+
if (!client.connect(host.c_str(), port)) {
3038
Serial.println("connection failed");
3139
continue;
3240
}

0 commit comments

Comments
 (0)