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

configure for https #345

Open
kaiyangli777 opened this issue Apr 5, 2021 · 2 comments
Open

configure for https #345

kaiyangli777 opened this issue Apr 5, 2021 · 2 comments

Comments

@kaiyangli777
Copy link

Hi there,

I am currently try to host cors-anywhere on my own server. I've done test with http://localhost:3030/url-of-the-actual-api, and it worked fine. I am now trying to use https://localhost:3030/url-of-the-actual-api, I've followed the instructions provided in issue#74, added the code below:
cors_anywhere = createServer({
httpsOptions: {
key: fs.readFileSync(path-to-the-key),
cert: fs.readFileSync(path-to-the-cert),
},
});

And I've also configured my apache config file and added a subdomain for port 3030, (xxx.mydomain.com) and it brings me to the page that shows "This API enables cross-origin requests to anywhere..." . However, when I make the cors API call with the subdomain with https (https://xxx.mydomain.com/url-of-the-actual-api), it responded with code 200 and the content of the "This API enables cross-origin requests to anywhere..." page, instead of the response content of the actual API call...

I'm doing something wrong? Could you give me some advice? Thank you in advance...

@Rob--W
Copy link
Owner

Rob--W commented Apr 5, 2021

This is not an issue with https (the fact that you see any response means that https has been configured as expected). This error is because of your Apache configuration.

Which version of CORS Anywhere are you using? Are you using the latest version of the master branch or the one from npm?

This is likely not an issue with CORS Anywhere, but a frequently occurring error that I introduced a new error message in 34ec83b

See https://github.com/Rob--W/cors-anywhere/issues/238#issuecomment-629638853

@kaiyangli777
Copy link
Author

Aha! Great catch! I will take a look, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants