This repository has been archived by the owner on Mar 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
8,940 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
### Bower ### | ||
bower_components | ||
.bower-cache | ||
.bower-registry | ||
.bower-tmp | ||
|
||
### Code ### | ||
# Visual Studio Code - https://code.visualstudio.com/ | ||
.settings/ | ||
.vscode/ | ||
tsconfig.json | ||
jsconfig.json | ||
|
||
### Emacs ### | ||
# -*- mode: gitignore; -*- | ||
*~ | ||
\#*\# | ||
/.emacs.desktop | ||
/.emacs.desktop.lock | ||
*.elc | ||
auto-save-list | ||
tramp | ||
.\#* | ||
|
||
# Org-mode | ||
.org-id-locations | ||
*_archive | ||
|
||
# flymake-mode | ||
*_flymake.* | ||
|
||
# eshell files | ||
/eshell/history | ||
/eshell/lastdir | ||
|
||
# elpa packages | ||
/elpa/ | ||
|
||
# reftex files | ||
*.rel | ||
|
||
# AUCTeX auto folder | ||
/auto/ | ||
|
||
# cask packages | ||
.cask/ | ||
dist/ | ||
|
||
# Flycheck | ||
flycheck_*.el | ||
|
||
|
||
# projectiles files | ||
.projectile | ||
|
||
# directory configuration | ||
.dir-locals.el | ||
|
||
### macOS ### | ||
*.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
build/ | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Typescript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
|
||
### Vim ### | ||
# swap | ||
[._]*.s[a-v][a-z] | ||
[._]*.sw[a-p] | ||
[._]s[a-v][a-z] | ||
[._]sw[a-p] | ||
# session | ||
Session.vim | ||
# temporary | ||
.netrwhist | ||
# auto-generated tag files | ||
tags | ||
|
||
local.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"disallowEmptyBlocks": true, | ||
"disallowSpacesInCallExpression": false, | ||
"disallowSpacesInsideArrayBrackets": false, | ||
"disallowSpacesInsideParentheses": false, | ||
"disallowQuotedKeysInObjects": true, | ||
"disallowSpaceAfterObjectKeys": false, | ||
"disallowSpaceAfterPrefixUnaryOperators": false, | ||
"disallowSpaceBeforePostfixUnaryOperators": false, | ||
"disallowSpaceBeforeBinaryOperators": [ | ||
"," | ||
], | ||
"disallowMixedSpacesAndTabs": true, | ||
"disallowTrailingWhitespace": true, | ||
"disallowSpaceBeforeComma": true, | ||
"disallowYodaConditions": true, | ||
"disallowKeywords": [ "with" ], | ||
"disallowKeywordsOnNewLine": ["else"], | ||
"disallowMultipleLineBreaks": false, | ||
"disallowMultipleLineStrings": true, | ||
"disallowMultipleVarDecl": true, | ||
"disallowSpaceBeforeSemicolon": true, | ||
"requireSpaceBeforeBlockStatements": true, | ||
"requireParenthesesAroundIIFE": true, | ||
"requireSpacesInConditionalExpression": true, | ||
"requireBlocksOnNewline": 1, | ||
"requireCommaBeforeLineBreak": true, | ||
"requireSpaceBeforeBinaryOperators": true, | ||
"requireSpaceAfterBinaryOperators": true, | ||
"requireLineFeedAtFileEnd": true, | ||
"requireCapitalizedConstructors": true, | ||
"requireDotNotation": true, | ||
"requireSpacesInForStatement": true, | ||
"requireSpaceBetweenArguments": true, | ||
"requireCurlyBraces": [ | ||
"do", | ||
"for", | ||
"try", | ||
"catch" | ||
], | ||
"requireSpaceAfterKeywords": [ | ||
"do", | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"switch", | ||
"case", | ||
"return", | ||
"try", | ||
"catch", | ||
"typeof", | ||
"function" | ||
], | ||
"requirePaddingNewLinesAfterBlocks": { | ||
"allExcept": ["inProperties"] | ||
}, | ||
"requireSemicolons": true, | ||
"safeContextKeyword": ["self", "ctx", "_this", "_self"], | ||
"validateLineBreaks": "LF", | ||
"validateQuoteMarks": "'", | ||
"validateIndentation": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
node_modules/ | ||
.nyc_output/ | ||
coverage/ | ||
tmp/ | ||
.vscode/ | ||
npm-debug.log | ||
.travis.yml | ||
test/ | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: node_js | ||
sudo: false | ||
node_js: | ||
- "8" | ||
- "9" | ||
install: | ||
- yarn install | ||
- yarn add coveralls | ||
script: | ||
- npm run coverage | ||
after_success: | ||
- nyc report --reporter=text-lcov | coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# FDOH | ||
|
||
[![npm version](https://img.shields.io/npm/v/fdoh.svg?style=flat-square)](https://www.npmjs.org/package/fdoh) | ||
[![Build Status](https://travis-ci.org/ptariche/fdoh.svg?branch=master)](https://travis-ci.org/ptariche/fdoh) | ||
[![Coverage Status](https://coveralls.io/repos/github/ptariche/fdoh/badge.svg?branch=master)](https://coveralls.io/github/ptariche/fdoh?branch=master) | ||
|
||
### Fetch with DNS over HTTPS | ||
|
||
The point of this utility is to be able to utilize node-fetch with your DNS queries running over HTTPS from Cloudflare [1.1.1.1](https://1.1.1.1) or Google DNS over HTTPS. | ||
|
||
### Fetch Example | ||
- [Link](./examples/fetch.js) | ||
|
||
### As Axios Interceptor | ||
Utilization of this can also be added as an [axios plugin](./examples/axios.js). | ||
|
||
### Installation | ||
|
||
```js | ||
npm install --save fdoh | ||
``` | ||
|
||
### Usage of Primary Class | ||
- *Fdoh* | ||
* Arguments | ||
+ **url** {String}(Fetch API Url) | ||
+ **options** {Object}(Fetch API Object) | ||
+ **provider** {String}(GOOGLE or CLOUDFLARE. Defaulted to Cloudflare) | ||
+ **responseWithConfig** {Boolean} (Utilized to return a basic config for middleware or interceptor libraries) | ||
|
||
* Returns {Optional Object or Function-Object} | ||
+ if responseWithConfig is not passed, [Node-Fetch](https://github.com/bitinn/node-fetch) is returned | ||
+ if responseWithConfig is set to true, an object is returned | ||
+ *Object* | ||
+ uri {String} | ||
+ headers {Object} | ||
|
||
|
||
### Dependencies | ||
- [dohdec](https://github.com/hildjj/dohdec) | ||
- [is-ip](https://github.com/sindresorhus/is-ip) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const Util = require('./util'); | ||
const Fdoh = require('./../index'); | ||
const Axios = require('axios'); | ||
|
||
Axios.interceptors.request.use( config => { | ||
return Fdoh(config.url, null, null, true) | ||
.then ( _config => { | ||
config.url = _config.url; | ||
config.headers = _config.headers; | ||
return Promise.resolve(config); | ||
}) | ||
.catch ( (err) => { | ||
return Promise.reject(err); | ||
}); | ||
}); | ||
|
||
Axios | ||
.get(Util.URL.NETFLIX) | ||
.then(response => Util._Log(response.data)) | ||
.catch(err => Util._Error(err)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const Util = require('./util'); | ||
const Fdoh = require('./../index'); | ||
const Fetch = Fdoh; | ||
|
||
Fetch(Util.URL.NETFLIX) | ||
.then (response => { | ||
response.json() | ||
.then( result => Util._Log(result)) | ||
.catch ( err => Util._Error(err) ); | ||
}) | ||
.catch ( err => Util._Error(err) ); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports._Error = (err) => console.error(err); | ||
module.exports._Log = (msg) => console.log(msg); | ||
module.exports.URL = { | ||
NETFLIX: 'https://help.netflix.com/api/en/deviceerrors?locale=en' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./lib/'); |
Oops, something went wrong.