2019-02-28 21:54:03 -08:00
|
|
|
/*
|
|
|
|
* ws.h
|
|
|
|
* Author: Benjamin Sergeant
|
|
|
|
* Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2020-03-11 10:48:27 -07:00
|
|
|
#include <ixcobra/IXCobraConfig.h>
|
2020-03-11 15:55:45 -07:00
|
|
|
#include <ixwebsocket/IXSocketTLSOptions.h>
|
2019-02-28 21:54:03 -08:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace ix
|
|
|
|
{
|
|
|
|
int ws_http_client_main(const std::string& url,
|
|
|
|
const std::string& headers,
|
|
|
|
const std::string& data,
|
|
|
|
bool headersOnly,
|
|
|
|
int connectTimeout,
|
|
|
|
int transferTimeout,
|
|
|
|
bool followRedirects,
|
|
|
|
int maxRedirects,
|
|
|
|
bool verbose,
|
|
|
|
bool save,
|
|
|
|
const std::string& output,
|
2019-09-29 18:29:51 -07:00
|
|
|
bool compress,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
|
|
|
|
|
|
|
int ws_ping_pong_main(const std::string& url, const ix::SocketTLSOptions& tlsOptions);
|
|
|
|
|
|
|
|
int ws_echo_server_main(int port,
|
|
|
|
bool greetings,
|
|
|
|
const std::string& hostname,
|
2020-01-26 16:44:44 -08:00
|
|
|
const ix::SocketTLSOptions& tlsOptions,
|
2020-02-18 21:38:28 -08:00
|
|
|
bool ipv6,
|
2020-03-18 00:01:57 -07:00
|
|
|
bool disablePerMessageDeflate,
|
|
|
|
bool disablePong);
|
2020-01-26 16:44:44 -08:00
|
|
|
|
2019-09-29 18:29:51 -07:00
|
|
|
int ws_broadcast_server_main(int port,
|
|
|
|
const std::string& hostname,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
|
|
|
int ws_transfer_main(int port,
|
|
|
|
const std::string& hostname,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
2019-02-28 21:54:03 -08:00
|
|
|
|
2019-05-30 08:46:50 -07:00
|
|
|
int ws_chat_main(const std::string& url, const std::string& user);
|
2019-02-28 21:54:03 -08:00
|
|
|
|
2019-06-06 13:48:53 -07:00
|
|
|
int ws_connect_main(const std::string& url,
|
2019-08-26 10:19:09 -07:00
|
|
|
const std::string& headers,
|
2019-06-06 13:48:53 -07:00
|
|
|
bool disableAutomaticReconnection,
|
2019-07-25 15:48:45 -07:00
|
|
|
bool disablePerMessageDeflate,
|
2019-08-30 12:46:35 -07:00
|
|
|
bool binaryMode,
|
2019-09-29 18:29:51 -07:00
|
|
|
uint32_t maxWaitBetweenReconnectionRetries,
|
2019-10-13 13:37:34 -07:00
|
|
|
const ix::SocketTLSOptions& tlsOptions,
|
2020-03-17 23:54:32 -07:00
|
|
|
const std::string& subprotocol,
|
|
|
|
int pingIntervalSecs);
|
2019-02-28 21:54:03 -08:00
|
|
|
|
2019-09-29 18:29:51 -07:00
|
|
|
int ws_receive_main(const std::string& url,
|
|
|
|
bool enablePerMessageDeflate,
|
|
|
|
int delayMs,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
2019-02-28 21:54:03 -08:00
|
|
|
|
2019-09-29 18:29:51 -07:00
|
|
|
int ws_send_main(const std::string& url,
|
|
|
|
const std::string& path,
|
2020-01-04 15:08:36 -08:00
|
|
|
bool disablePerMessageDeflate,
|
2019-09-29 18:29:51 -07:00
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
2019-03-20 14:29:02 -07:00
|
|
|
|
2020-06-11 17:30:42 -07:00
|
|
|
int ws_redis_cli_main(const std::string& hostname,
|
|
|
|
int port,
|
|
|
|
const std::string& password);
|
|
|
|
|
2019-03-20 14:29:02 -07:00
|
|
|
int ws_redis_publish_main(const std::string& hostname,
|
|
|
|
int port,
|
2019-03-26 09:33:22 -07:00
|
|
|
const std::string& password,
|
2019-03-20 14:29:02 -07:00
|
|
|
const std::string& channel,
|
2019-03-27 13:41:46 -07:00
|
|
|
const std::string& message,
|
|
|
|
int count);
|
2019-03-20 14:29:02 -07:00
|
|
|
|
|
|
|
int ws_redis_subscribe_main(const std::string& hostname,
|
|
|
|
int port,
|
2019-03-26 09:33:22 -07:00
|
|
|
const std::string& password,
|
2019-03-20 14:29:02 -07:00
|
|
|
const std::string& channel,
|
|
|
|
bool verbose);
|
2019-04-08 21:52:20 -07:00
|
|
|
|
2020-03-11 10:48:27 -07:00
|
|
|
int ws_cobra_publish_main(const ix::CobraConfig& appkey,
|
2019-04-21 11:16:33 -07:00
|
|
|
const std::string& channel,
|
2020-03-11 12:40:32 -07:00
|
|
|
const std::string& path);
|
2019-09-19 12:51:11 -07:00
|
|
|
|
2020-03-11 10:48:27 -07:00
|
|
|
int ws_cobra_metrics_publish_main(const ix::CobraConfig& config,
|
2019-09-19 12:51:11 -07:00
|
|
|
const std::string& channel,
|
|
|
|
const std::string& path,
|
2020-03-11 12:40:32 -07:00
|
|
|
bool stress);
|
2019-04-21 11:16:33 -07:00
|
|
|
|
2020-03-11 10:48:27 -07:00
|
|
|
int ws_cobra_metrics_to_redis(const ix::CobraConfig& config,
|
2019-10-24 14:42:25 -07:00
|
|
|
const std::string& channel,
|
|
|
|
const std::string& filter,
|
2020-03-13 16:06:13 -07:00
|
|
|
const std::string& position,
|
2019-10-24 14:42:25 -07:00
|
|
|
const std::string& host,
|
2020-03-11 12:40:32 -07:00
|
|
|
int port);
|
2019-10-24 14:42:25 -07:00
|
|
|
|
2019-04-22 17:24:01 -07:00
|
|
|
int ws_snake_main(int port,
|
|
|
|
const std::string& hostname,
|
|
|
|
const std::string& redisHosts,
|
|
|
|
int redisPort,
|
|
|
|
const std::string& redisPassword,
|
|
|
|
bool verbose,
|
2019-12-19 20:49:28 -08:00
|
|
|
const std::string& appsConfigPath,
|
2020-01-31 16:55:54 -08:00
|
|
|
const ix::SocketTLSOptions& tlsOptions,
|
|
|
|
bool disablePong);
|
2019-06-23 14:54:21 -07:00
|
|
|
|
2019-09-26 09:10:30 -07:00
|
|
|
int ws_httpd_main(int port,
|
|
|
|
const std::string& hostname,
|
|
|
|
bool redirect,
|
2019-09-29 18:29:51 -07:00
|
|
|
const std::string& redirectUrl,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
2019-08-31 16:46:44 -07:00
|
|
|
|
2019-09-01 10:45:51 -07:00
|
|
|
int ws_autobahn_main(const std::string& url, bool quiet);
|
2019-09-23 21:04:01 -07:00
|
|
|
|
|
|
|
int ws_redis_server_main(int port, const std::string& hostname);
|
2019-11-15 14:30:20 -08:00
|
|
|
|
|
|
|
int ws_proxy_server_main(int port,
|
|
|
|
const std::string& hostname,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions,
|
|
|
|
const std::string& remoteHost,
|
2019-11-15 17:18:32 -08:00
|
|
|
bool verbose);
|
2019-11-25 21:08:43 -08:00
|
|
|
|
|
|
|
int ws_sentry_minidump_upload(const std::string& metadataPath,
|
|
|
|
const std::string& minidump,
|
|
|
|
const std::string& project,
|
|
|
|
const std::string& key,
|
|
|
|
bool verbose);
|
2020-01-22 21:11:48 -08:00
|
|
|
|
|
|
|
int ws_dns_lookup(const std::string& hostname);
|
2019-05-30 08:46:50 -07:00
|
|
|
} // namespace ix
|