adding in examples of headers and origin
This commit is contained in:
+4
-1
@@ -29,8 +29,11 @@ int main()
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
std::map<std::string, std::string> headers;
|
||||
headers.insert(std::make_pair("Authorization", "Bearer 123"));
|
||||
std::string origin = "https://example.com";
|
||||
|
||||
ws = WebSocket::from_url("ws://localhost:8126/foo");
|
||||
ws = WebSocket::from_url("ws://localhost:8126/foo", origin, headers);
|
||||
assert(ws);
|
||||
ws->send("goodbye");
|
||||
ws->send("hello");
|
||||
|
||||
Reference in New Issue
Block a user