-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
39 lines (30 loc) · 995 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// Created by Katie on 15/11/2024.
//
#include <chrono>
#include <iostream>
#include <thread>
#include "includes/api/WebSocketClient.h"
int main() {
std::string address;
std::string port;
std::string endpoint;
int connectionStatus = 0;
do {
std::cout << "Enter WebSocket server address:\n";
std::cin >> address;
std::cout << "\n";
std::cout << "Enter WebSocket server port:\n";
std::cin >> port;
std::cout << "\n";
std::cout << "Enter WebSocket endpoint:\n";
std::cin >> endpoint;
std::cout << "\n";
WebSocketClient client(address, port, "/publisher/" + endpoint);
connectionStatus = client.run();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
} while (connectionStatus != 0);
// WebSocketClient client("192.168.1.102", "8080", "/publisher/matrix");
// WebSocketClient client("localhost", "8080", "/publisher/matrix-test");
return 0;
}