mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
* Move uWebSockets and uSockets forks into Bun's repository * Update Makefile * Update settings.json * Update libuwsockets.cpp * Remove backends we won't be using * Update bindings.cpp --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
23 lines
550 B
C++
23 lines
550 B
C++
// This example is broken and doesn't do anything. It is a potential interface for a future potential client.
|
|
|
|
#include "ClientApp.h"
|
|
#include <iostream>
|
|
|
|
int main() {
|
|
uWS::ClientApp app({
|
|
.open = [](/*auto *ws*/) {
|
|
std::cout << "Hello and welcome to client" << std::endl;
|
|
},
|
|
.message = [](/*auto *ws, auto message*/) {
|
|
|
|
},
|
|
.close = [](/*auto *ws*/) {
|
|
std::cout << "bye" << std::endl;
|
|
}
|
|
});
|
|
|
|
app.connect("ws://localhost:3000", "protocol");
|
|
|
|
app.run();
|
|
}
|