cloudflare
Version:
The official TypeScript library for the Cloudflare API
26 lines • 1.1 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
export class OpportunisticOnion extends APIResource {
/**
* Add an Alt-Svc header to all legitimate requests from Tor, allowing the
* connection to use our onion services instead of exit nodes.
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch(`/zones/${zone_id}/settings/opportunistic_onion`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Add an Alt-Svc header to all legitimate requests from Tor, allowing the
* connection to use our onion services instead of exit nodes.
*/
get(params, options) {
const { zone_id } = params;
return this._client.get(`/zones/${zone_id}/settings/opportunistic_onion`, options)._thenUnwrap((obj) => obj.result);
}
}
(function (OpportunisticOnion) {
})(OpportunisticOnion || (OpportunisticOnion = {}));
//# sourceMappingURL=opportunistic-onion.mjs.map