Commit Graph

2 Commits

Author SHA1 Message Date
Martin Natano 134fa9a3d9 IXWebSocket: Allow to cancel asynchronous HTTP requests
Usage:

    auto args = this->httpClient.createRequest(url, method);
    httpClient.performRequest(args, ...);
    [...]
    // Oops, we don't actually want to complete the request!
    args->cancel = true;

Submitted upstream:
https://github.com/machinezone/IXWebSocket/pull/332
2022-01-15 22:56:22 +01:00
Martin Natano dc49af3c59 Implement NetworkManager
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.
2022-01-15 22:56:08 +01:00