Skip to content

Commit e48d661

Browse files
committedNov 26, 2017
Initial commit
0 parents  commit e48d661

11 files changed

+5834
-0
lines changed
 

‎.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

‎.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

‎.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
*.log
3+
.idea
4+
node_modules
5+
coverage
6+
.nyc_output

‎.remarkignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test/snapshots/**/*.md

‎.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: node_js
2+
node_js:
3+
- '8'
4+
after_success:
5+
npm run coverage

‎LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# [**@ladjs/proxy**](https://github.com/ladjs/proxy)
2+
3+
[![build status](https://img.shields.io/travis/ladjs/proxy.svg)](https://travis-ci.org/ladjs/proxy)
4+
[![code coverage](https://img.shields.io/codecov/c/github/ladjs/proxy.svg)](https://codecov.io/gh/ladjs/proxy)
5+
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
6+
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
7+
[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)
8+
[![license](https://img.shields.io/github/license/ladjs/proxy.svg)](LICENSE)
9+
10+
> Proxy for Lad
11+
12+
13+
## Table of Contents
14+
15+
* [Install](#install)
16+
* [Usage](#usage)
17+
* [Contributors](#contributors)
18+
* [License](#license)
19+
20+
21+
## Install
22+
23+
[npm][]:
24+
25+
```sh
26+
npm install @ladjs/proxy
27+
```
28+
29+
[yarn][]:
30+
31+
```sh
32+
yarn add @ladjs/proxy
33+
```
34+
35+
36+
## Usage
37+
38+
```js
39+
const proxy = require('@ladjs/proxy');
40+
if (!module.parent) proxy.listen(80);
41+
module.exports = proxy;
42+
```
43+
44+
45+
## Contributors
46+
47+
| Name | Website |
48+
| -------------- | -------------------------- |
49+
| **Nick Baugh** | <http://niftylettuce.com/> |
50+
51+
52+
## License
53+
54+
[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)
55+
56+
57+
##
58+
59+
[npm]: https://www.npmjs.com/
60+
61+
[yarn]: https://yarnpkg.com/

‎index.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const http = require('http');
2+
const url = require('url');
3+
4+
const proxy = http.createServer((req, res) => {
5+
res.writeHead(301, {
6+
Location: url.parse(`https://${req.headers.host}${req.url}`).href
7+
});
8+
9+
res.end();
10+
});
11+
12+
if (!module.parent) proxy.listen(80);
13+
14+
module.exports = proxy;

‎package.json

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{
2+
"name": "@ladjs/proxy",
3+
"description": "Proxy for Lad",
4+
"version": "0.0.1",
5+
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",
6+
"bugs": {
7+
"url": "https://github.com/ladjs/proxy/issues",
8+
"email": "niftylettuce@gmail.com"
9+
},
10+
"contributors": [
11+
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)"
12+
],
13+
"dependencies": {},
14+
"ava": {
15+
"failFast": true,
16+
"verbose": true
17+
},
18+
"devDependencies": {
19+
"ava": "^0.22.0",
20+
"codecov": "^2.3.0",
21+
"cross-env": "^5.0.5",
22+
"eslint": "^4.5.0",
23+
"eslint-config-prettier": "^2.3.0",
24+
"eslint-plugin-prettier": "^2.2.0",
25+
"husky": "^0.14.3",
26+
"lint-staged": "^4.0.4",
27+
"nyc": "^11.1.0",
28+
"prettier": "^1.6.1",
29+
"remark-cli": "^4.0.0",
30+
"remark-preset-github": "^0.0.6",
31+
"xo": "^0.19.0"
32+
},
33+
"engines": {
34+
"node": ">=8.3"
35+
},
36+
"homepage": "https://github.com/ladjs/proxy",
37+
"keywords": [
38+
"proxy",
39+
"lad",
40+
"koa",
41+
"http",
42+
"handler",
43+
"nginx",
44+
"reverse",
45+
"https",
46+
"hosts",
47+
"host",
48+
"config",
49+
"forward",
50+
"port",
51+
"forwarding",
52+
"tls",
53+
"encrypted",
54+
"tunnel",
55+
"vhost",
56+
"virtual",
57+
"virtuals",
58+
"ports",
59+
"domain",
60+
"domains"
61+
],
62+
"license": "MIT",
63+
"lint-staged": {
64+
"*.{js,jsx,mjs,ts,tsx,css,less,scss,json,graphql}": [
65+
"prettier --write --single-quote --trailing-comma none",
66+
"git add"
67+
],
68+
"*.md": ["remark . -qfo", "git add"]
69+
},
70+
"main": "index.js",
71+
"remarkConfig": {
72+
"plugins": ["preset-github"]
73+
},
74+
"repository": {
75+
"type": "git",
76+
"url": "https://github.com/ladjs/proxy"
77+
},
78+
"scripts": {
79+
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
80+
"lint": "xo && remark . -qfo",
81+
"precommit": "lint-staged && npm test",
82+
"test": "npm run lint && npm run test-coverage",
83+
"test-coverage": "cross-env NODE_ENV=test nyc ava"
84+
},
85+
"xo": {
86+
"extends": "prettier",
87+
"plugins": ["prettier"],
88+
"parserOptions": {
89+
"sourceType": "script"
90+
},
91+
"rules": {
92+
"prettier/prettier": [
93+
"error",
94+
{
95+
"singleQuote": true,
96+
"bracketSpacing": true,
97+
"trailingComma": "none"
98+
}
99+
],
100+
"max-len": [
101+
"error",
102+
{
103+
"code": 80,
104+
"ignoreUrls": true
105+
}
106+
],
107+
"capitalized-comments": "off",
108+
"camelcase": "off",
109+
"no-warning-comments": "off"
110+
},
111+
"space": true
112+
}
113+
}

‎test/test.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const test = require('ava');
2+
3+
test.todo('write tests');

‎yarn.lock

+5,600
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.