Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function () {
- 'use strict';
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
- if (staticProps) _defineProperties(Constructor, staticProps);
- return Constructor;
- }
- var proxyConfig = {
- USE_PROXY: false,
- PROXY: {
- PROXY_PROTOCOL: 'http',
- PROXY_HOST: 'proxy.eng.it',
- PROXY_PORT: '3128',
- PROXY_CREDENTIAL: {
- PROXY_USERNAME: 'dtrombin',
- PROXY_PASSWORD: 'Accountecng1993'
- }
- }
- };
- var HTTPClient =
- /*#__PURE__*/
- function () {
- function HTTPClient() {
- _classCallCheck(this, HTTPClient);
- }
- _createClass(HTTPClient, [{
- key: "get",
- value: function get(url) {
- var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- opts.method = "GET";
- fetch(url, opts);
- }
- }, {
- key: "post",
- value: function post(url) {
- var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- opts.method = "POST";
- fetch(url, opts);
- }
- }, {
- key: "head",
- value: function head(url) {
- var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- opts.method = "HEAD";
- fetch(url, opts);
- }
- }, {
- key: "delete",
- value: function _delete(url) {
- var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- opts.method = "DELETE";
- fetch(url, opts);
- }
- }, {
- key: "update",
- value: function update(url) {
- var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- opts.method = "UPDATE";
- fetch(url, opts);
- }
- }, {
- key: "setProxy",
- value: function setProxy() {
- var proxy = proxyConfig.PROXY;
- var proxyString = proxy.PROXY_PROTOCOL.concat("://").concat(proxy.PROXY_CREDENTIAL.PROXY_USERNAME).concat(":").concat(proxy.PROXY_CREDENTIAL.PROXY_PASSWORD).concat('@').concat(proxy.PROXY_HOST).concat(":").concat(proxy.PROXY_PORT);
- return proxyString; //new HttpsProxyAgent(proxy);
- }
- }]);
- return HTTPClient;
- }();
- }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement