Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge upstream #1

Merged
merged 47 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
81ed058
Update mocha to ^3.4.2
Rob--W Jul 13, 2017
dcc6405
Change response handling hook
Rob--W Jul 13, 2017
ded44cb
Upgrade supertest + nock to recent version
Rob--W Jul 13, 2017
99133b0
Explicit Node versions in Travis build matrix
Rob--W Jul 13, 2017
f016bd7
Update test expectation for "100 GET requests 50k"
Rob--W Jul 13, 2017
70400ab
Monkey-patch nock, add Node v8 to test matrix
Rob--W Jul 13, 2017
881392c
Add maxAge config option. If set, an Access-Control-Max-Age header wi…
gnjack Jul 13, 2017
10df7c9
Rename maxAge to corsMaxAge and set the default corsMaxAge to 0.
gnjack Jul 14, 2017
49d429d
Do not send Access-Control-Max-Age header if corsMaxAge is 0 (default)
gnjack Jul 14, 2017
143eff1
Merge pull request #77 from gnjack/maxAge
Rob--W Jul 16, 2017
4a46541
Catch error due to invalid status code (#95)
Rob--W Nov 8, 2017
53101b9
Update gTLD list
Rob--W Nov 10, 2017
6741f81
Remove engines.npm (#92)
Rob--W Nov 10, 2017
d2b5dd3
Add Node 9.x to Travis
Rob--W Nov 11, 2017
7b6ce1a
Fix failing tests for 0.10.x, 4.x and 5.x
Rob--W Nov 11, 2017
b419acc
Explicitly list all files for the npm package
Rob--W Dec 1, 2017
2ee3147
Version 0.4.1
Rob--W Dec 1, 2017
462f844
Fix failing test in test/test-ratelimit
Rob--W Oct 31, 2018
4814647
Reject invalid requests instead of crashing (#142)
Rob--W Oct 31, 2018
7222fce
Extend supported Node.js from <=9 to <=14
Rob--W May 2, 2020
20d5d04
test-memory: destroy response to free socket
Rob--W May 2, 2020
4ddb796
Explicit early out for invalid URLs
Rob--W May 2, 2020
a214003
Version 0.4.2
Rob--W May 2, 2020
001fbef
Update test expectation for Node 12.x
Rob--W May 2, 2020
2579fb6
test-memory: fix test by passing --max-http-header-size
Rob--W May 2, 2020
0a3b8e9
Pass --max-http-header-size in supported versions only
Rob--W May 2, 2020
a9e06a9
Reject invalid redirects
Rob--W May 6, 2020
a0309e6
Version 0.4.3
Rob--W May 6, 2020
b3a13b0
only send Access-Control-Max-Age if preflight request, not POST/GET
bulk88 Sep 27, 2020
3bab870
Merge pull request #277 from bulk88/no_AC_max_age_header_on_get_post_…
Rob--W Sep 27, 2020
7271e29
remove Heroku specific Req headers from being sent to Origin
bulk88 Sep 24, 2020
c8a2091
Merge pull request #278 from bulk88/no_heroku_headers_to_origin
Rob--W Sep 28, 2020
528ad71
Remove obsolete values from server.js's removeHeaders
Rob--W Sep 28, 2020
9f1af82
Add handleInitialRequest option to support #301
Rob--W Feb 1, 2021
4c18680
Expand handleInitialRequest documentation #335
Rob--W Mar 17, 2021
1bd9528
Add note about availability of public demo server
Rob--W Mar 17, 2021
94a325b
Update gTLD list
Rob--W Mar 17, 2021
d10efb1
Version 0.4.4
Rob--W Mar 17, 2021
3c87a51
Support NODE_TLS_REJECT_UNAUTHORIZED=0 to ignore client errors #341
Rob--W Mar 21, 2021
a9143e7
Fix test expectation for old node
Rob--W Mar 22, 2021
d33bd64
Migrate travis-ci from .org to .com
Rob--W Mar 22, 2021
207e1e9
Add Node 15.x to Travis
Rob--W Mar 22, 2021
34ec83b
Show "400 Missing slash" when needed #238
Rob--W Mar 22, 2021
02f0cbd
Add LICENSE file based on README.md #297
Rob--W Mar 22, 2021
c84078b
Fix typo
callmenoodles Aug 31, 2021
70aaa22
Merge pull request #376 from alex-lushiku/patch-1
Rob--W Sep 4, 2021
1bd13ac
Merge remote-tracking branch 'upstream/master' into merge-upstream
llimllib Oct 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
language: node_js
node_js:
- node
- 0.10
- 4
- 6
- 7
- 8
- 9
- 11
- 12
- 13
- 13
- 14
- 15
script:
- npm run lint
- npm run test
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (C) 2013 - 2021 Rob Wu <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/Rob--W/cors-anywhere.svg?branch=master)](https://travis-ci.org/Rob--W/cors-anywhere)
[![Build Status](https://travis-ci.com/Rob--W/cors-anywhere.svg?branch=master)](https://travis-ci.com/Rob--W/cors-anywhere)
[![Coverage Status](https://coveralls.io/repos/github/Rob--W/cors-anywhere/badge.svg?branch=master)](https://coveralls.io/github/Rob--W/cors-anywhere?branch=master)

**CORS Anywhere** is a NodeJS proxy which adds CORS headers to the proxied request.
Expand Down Expand Up @@ -35,7 +35,7 @@ Request examples:
* `http://localhost:8080/http://google.com/` - Google.com with CORS headers
* `http://localhost:8080/google.com` - Same as previous.
* `http://localhost:8080/google.com:443` - Proxies `https://google.com/`
* `http://localhost:8080/` - Shows usage text, as defined in `libs/help.txt`
* `http://localhost:8080/` - Shows usage text, as defined in `lib/help.txt`
* `http://localhost:8080/favicon.ico` - Replies 404 Not found

Live examples:
Expand All @@ -50,6 +50,9 @@ Live examples:
To use the API, just prefix the URL with the API URL. Take a look at [demo.html](demo.html) for an example.
A concise summary of the documentation is provided at [lib/help.txt](lib/help.txt).

**Note: as of February 2021, access to the demo server requires an opt-in**,
see: https://github.com/Rob--W/cors-anywhere/issues/301

If you want to automatically enable cross-domain requests when needed, use the following snippet:

```javascript
Expand Down Expand Up @@ -95,6 +98,10 @@ proxy requests. The following options are supported:
* array of strings `originWhitelist` - If set, requests whose origin is not listed are blocked.
If this list is empty, all origins are allowed.
Example: `['https://good.example.com', 'http://good.example.com']`
* function `handleInitialRequest` - If set, it is called with the request, response and a parsed
URL of the requested destination (null if unavailable). If the function returns true, the request
will not be handled further. Then the function is responsible for handling the request.
This feature can be used to passively monitor requests, for example for logging (return false).
* function `checkRateLimit` - If set, it is called with the origin (string) of the request. If this
function returns a non-empty string, the request is rejected and the string is send to the client.
* boolean `redirectSameOrigin` - If true, requests to URLs from the same origin will not be proxied but redirected.
Expand All @@ -107,6 +114,8 @@ proxy requests. The following options are supported:
Example: `["cookie"]`
* dictionary of lowercase strings `setHeaders` - Set headers for the request (overwrites existing ones).
Example: `{"x-powered-by": "CORS Anywhere"}`
* number `corsMaxAge` - If set, an Access-Control-Max-Age request header with this value (in seconds) will be added.
Example: `600` - Allow CORS preflight request to be cached by the browser for 10 minutes.
* string `helpFile` - Set the help file (shown at the homepage).
Example: `"myCustomHelpText.txt"`

Expand All @@ -128,6 +137,9 @@ only provided so that you can easily and quickly try out CORS Anywhere. To ensur
stays available to everyone, the number of requests per period is limited, except for requests from
some explicitly whitelisted origins.

**Note: as of February 2021, access to the demo server requires an opt-in**,
see: https://github.com/Rob--W/cors-anywhere/issues/301

If you expect lots of traffic, please host your own instance of CORS Anywhere, and make sure that
the CORS Anywhere server only whitelists your site to prevent others from using your instance of
CORS Anywhere as an open proxy.
Expand Down Expand Up @@ -158,7 +170,7 @@ node server.js

## License

Copyright (C) 2013 - 2016 Rob Wu <[email protected]>
Copyright (C) 2013 - 2021 Rob Wu <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
Loading