2019-03-01 06:54:03 +01:00
|
|
|
/*
|
|
|
|
* ws.h
|
|
|
|
* Author: Benjamin Sergeant
|
|
|
|
* Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2019-09-30 03:29:51 +02:00
|
|
|
#include <ixwebsocket/IXSocketTLSOptions.h>
|
2019-03-01 06:54:03 +01: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-30 03:29:51 +02: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,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
|
|
|
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-03-01 06:54:03 +01:00
|
|
|
|
2019-05-30 17:46:50 +02:00
|
|
|
int ws_chat_main(const std::string& url, const std::string& user);
|
2019-03-01 06:54:03 +01:00
|
|
|
|
2019-06-06 22:48:53 +02:00
|
|
|
int ws_connect_main(const std::string& url,
|
2019-08-26 19:19:09 +02:00
|
|
|
const std::string& headers,
|
2019-06-06 22:48:53 +02:00
|
|
|
bool disableAutomaticReconnection,
|
2019-07-26 00:48:45 +02:00
|
|
|
bool disablePerMessageDeflate,
|
2019-08-30 21:46:35 +02:00
|
|
|
bool binaryMode,
|
2019-09-30 03:29:51 +02:00
|
|
|
uint32_t maxWaitBetweenReconnectionRetries,
|
2019-10-13 22:37:34 +02:00
|
|
|
const ix::SocketTLSOptions& tlsOptions,
|
|
|
|
const std::string& subprotocol);
|
2019-03-01 06:54:03 +01:00
|
|
|
|
2019-09-30 03:29:51 +02:00
|
|
|
int ws_receive_main(const std::string& url,
|
|
|
|
bool enablePerMessageDeflate,
|
|
|
|
int delayMs,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
2019-03-01 06:54:03 +01:00
|
|
|
|
2019-09-30 03:29:51 +02:00
|
|
|
int ws_send_main(const std::string& url,
|
|
|
|
const std::string& path,
|
2020-01-05 00:08:36 +01:00
|
|
|
bool disablePerMessageDeflate,
|
2019-09-30 03:29:51 +02:00
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
2019-03-20 22:29:02 +01:00
|
|
|
|
|
|
|
int ws_redis_publish_main(const std::string& hostname,
|
|
|
|
int port,
|
2019-03-26 17:33:22 +01:00
|
|
|
const std::string& password,
|
2019-03-20 22:29:02 +01:00
|
|
|
const std::string& channel,
|
2019-03-27 21:41:46 +01:00
|
|
|
const std::string& message,
|
|
|
|
int count);
|
2019-03-20 22:29:02 +01:00
|
|
|
|
|
|
|
int ws_redis_subscribe_main(const std::string& hostname,
|
|
|
|
int port,
|
2019-03-26 17:33:22 +01:00
|
|
|
const std::string& password,
|
2019-03-20 22:29:02 +01:00
|
|
|
const std::string& channel,
|
|
|
|
bool verbose);
|
2019-04-09 06:52:20 +02:00
|
|
|
|
|
|
|
int ws_cobra_subscribe_main(const std::string& appkey,
|
|
|
|
const std::string& endpoint,
|
|
|
|
const std::string& rolename,
|
|
|
|
const std::string& rolesecret,
|
2019-08-02 00:22:24 +02:00
|
|
|
const std::string& channel,
|
|
|
|
const std::string& filter,
|
2019-12-20 05:49:28 +01:00
|
|
|
bool quiet,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
2019-04-09 06:52:20 +02:00
|
|
|
|
2019-04-21 20:16:33 +02:00
|
|
|
int ws_cobra_publish_main(const std::string& appkey,
|
|
|
|
const std::string& endpoint,
|
|
|
|
const std::string& rolename,
|
|
|
|
const std::string& rolesecret,
|
|
|
|
const std::string& channel,
|
2019-12-20 05:49:28 +01:00
|
|
|
const std::string& path,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
2019-09-19 21:51:11 +02:00
|
|
|
|
|
|
|
int ws_cobra_metrics_publish_main(const std::string& appkey,
|
|
|
|
const std::string& endpoint,
|
|
|
|
const std::string& rolename,
|
|
|
|
const std::string& rolesecret,
|
|
|
|
const std::string& channel,
|
|
|
|
const std::string& path,
|
2019-12-20 05:49:28 +01:00
|
|
|
bool stress,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
2019-04-21 20:16:33 +02:00
|
|
|
|
2019-04-09 06:52:20 +02:00
|
|
|
int ws_cobra_to_statsd_main(const std::string& appkey,
|
|
|
|
const std::string& endpoint,
|
|
|
|
const std::string& rolename,
|
|
|
|
const std::string& rolesecret,
|
|
|
|
const std::string& channel,
|
2019-08-02 00:22:24 +02:00
|
|
|
const std::string& filter,
|
2019-04-09 06:52:20 +02:00
|
|
|
const std::string& host,
|
|
|
|
int port,
|
|
|
|
const std::string& prefix,
|
|
|
|
const std::string& fields,
|
2019-12-20 05:49:28 +01:00
|
|
|
bool verbose,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
2019-04-18 05:31:34 +02:00
|
|
|
|
2019-04-12 01:03:05 +02:00
|
|
|
int ws_cobra_to_sentry_main(const std::string& appkey,
|
|
|
|
const std::string& endpoint,
|
|
|
|
const std::string& rolename,
|
|
|
|
const std::string& rolesecret,
|
|
|
|
const std::string& channel,
|
2019-08-02 00:22:24 +02:00
|
|
|
const std::string& filter,
|
2019-04-12 01:03:05 +02:00
|
|
|
const std::string& dsn,
|
|
|
|
bool verbose,
|
|
|
|
bool strict,
|
2019-12-20 05:49:28 +01:00
|
|
|
int jobs,
|
2019-12-26 07:15:57 +01:00
|
|
|
size_t maxQueueSize,
|
2019-12-20 05:49:28 +01:00
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
2019-04-23 02:24:01 +02:00
|
|
|
|
2019-10-24 23:42:25 +02:00
|
|
|
int ws_cobra_metrics_to_redis(const std::string& appkey,
|
|
|
|
const std::string& endpoint,
|
|
|
|
const std::string& rolename,
|
|
|
|
const std::string& rolesecret,
|
|
|
|
const std::string& channel,
|
|
|
|
const std::string& filter,
|
|
|
|
const std::string& host,
|
2019-12-20 05:49:28 +01:00
|
|
|
int port,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
2019-10-24 23:42:25 +02:00
|
|
|
|
2019-04-23 02:24:01 +02: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-20 05:49:28 +01:00
|
|
|
const std::string& appsConfigPath,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
2019-06-23 23:54:21 +02:00
|
|
|
|
2019-09-26 18:10:30 +02:00
|
|
|
int ws_httpd_main(int port,
|
|
|
|
const std::string& hostname,
|
|
|
|
bool redirect,
|
2019-09-30 03:29:51 +02:00
|
|
|
const std::string& redirectUrl,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions);
|
2019-09-01 01:46:44 +02:00
|
|
|
|
2019-09-01 19:45:51 +02:00
|
|
|
int ws_autobahn_main(const std::string& url, bool quiet);
|
2019-09-24 06:04:01 +02:00
|
|
|
|
|
|
|
int ws_redis_server_main(int port, const std::string& hostname);
|
2019-11-15 23:30:20 +01:00
|
|
|
|
|
|
|
int ws_proxy_server_main(int port,
|
|
|
|
const std::string& hostname,
|
|
|
|
const ix::SocketTLSOptions& tlsOptions,
|
|
|
|
const std::string& remoteHost,
|
2019-11-16 02:18:32 +01:00
|
|
|
bool verbose);
|
2019-11-26 06:08:43 +01:00
|
|
|
|
|
|
|
int ws_sentry_minidump_upload(const std::string& metadataPath,
|
|
|
|
const std::string& minidump,
|
|
|
|
const std::string& project,
|
|
|
|
const std::string& key,
|
|
|
|
bool verbose);
|
2019-05-30 17:46:50 +02:00
|
|
|
} // namespace ix
|