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.
32 lines
784 B
C++
32 lines
784 B
C++
/*
|
|
* IXSocketConnect.h
|
|
* Author: Benjamin Sergeant
|
|
* Copyright (c) 2018 Machine Zone, Inc. All rights reserved.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "IXCancellationRequest.h"
|
|
#include <string>
|
|
|
|
struct addrinfo;
|
|
|
|
namespace ix
|
|
{
|
|
class SocketConnect
|
|
{
|
|
public:
|
|
static int connect(const std::string& hostname,
|
|
int port,
|
|
std::string& errMsg,
|
|
const CancellationRequest& isCancellationRequested);
|
|
|
|
static void configure(int sockfd);
|
|
|
|
private:
|
|
static int connectToAddress(const struct addrinfo* address,
|
|
std::string& errMsg,
|
|
const CancellationRequest& isCancellationRequested);
|
|
};
|
|
} // namespace ix
|