2019-03-01 06:54:03 +01:00
|
|
|
/*
|
|
|
|
* ws.h
|
|
|
|
* Author: Benjamin Sergeant
|
|
|
|
* Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#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,
|
|
|
|
bool compress);
|
|
|
|
|
|
|
|
int ws_ping_pong_main(const std::string& url);
|
|
|
|
|
2019-06-08 18:16:33 +02:00
|
|
|
int ws_echo_server_main(int port, bool greetings, const std::string& hostname);
|
2019-03-11 00:36:44 +01:00
|
|
|
int ws_broadcast_server_main(int port, const std::string& hostname);
|
2019-03-14 07:09:45 +01:00
|
|
|
int ws_transfer_main(int port, const std::string& hostname);
|
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,
|
|
|
|
uint32_t maxWaitBetweenReconnectionRetries);
|
2019-03-01 06:54:03 +01:00
|
|
|
|
2019-05-30 17:46:50 +02:00
|
|
|
int ws_receive_main(const std::string& url, bool enablePerMessageDeflate, int delayMs);
|
2019-03-01 06:54:03 +01:00
|
|
|
|
2019-05-30 17:46:50 +02:00
|
|
|
int ws_send_main(const std::string& url, const std::string& path);
|
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,
|
|
|
|
bool quiet);
|
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-09-19 21:51:11 +02:00
|
|
|
const std::string& path);
|
|
|
|
|
|
|
|
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,
|
|
|
|
bool stress);
|
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,
|
|
|
|
bool verbose);
|
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,
|
|
|
|
int jobs);
|
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,
|
|
|
|
const std::string& appsConfigPath);
|
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,
|
|
|
|
const std::string& redirectUrl);
|
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-05-30 17:46:50 +02:00
|
|
|
} // namespace ix
|