dc49af3c59
For now there are two methods: - `NETWORK:IsUrlAllowed()`: Check whether access to a certain URL is allowed. - `NETWORK:HttpRequest()`: Perform an HTTP request. By default access to the network is disabled for all target hosts. It can be enabled by setting `HttpEnable=1` in the preferences. Individual hosts have to be added to `HttpAllowHosts` as a comma separated list to allow access. See included docs for more details on usage.
37 lines
928 B
C++
37 lines
928 B
C++
/*
|
|
* IXWebSocketInitResult.h
|
|
* Author: Benjamin Sergeant
|
|
* Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "IXWebSocketHttpHeaders.h"
|
|
|
|
namespace ix
|
|
{
|
|
struct WebSocketInitResult
|
|
{
|
|
bool success;
|
|
int http_status;
|
|
std::string errorStr;
|
|
WebSocketHttpHeaders headers;
|
|
std::string uri;
|
|
std::string protocol;
|
|
|
|
WebSocketInitResult(bool s = false,
|
|
int status = 0,
|
|
const std::string& e = std::string(),
|
|
WebSocketHttpHeaders h = WebSocketHttpHeaders(),
|
|
const std::string& u = std::string())
|
|
{
|
|
success = s;
|
|
http_status = status;
|
|
errorStr = e;
|
|
headers = h;
|
|
uri = u;
|
|
protocol = h["Sec-WebSocket-Protocol"];
|
|
}
|
|
};
|
|
} // namespace ix
|