Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emulate cross-site requests in localhost

Is there a way to make cross-site requests in the localhost? To emulate a different domain? How do you make an application, for example to do JSON-P or CORS and test it in your local machine without having an actual domain?

I am using NodeJS and WebStorm.

Thank you.

like image 262
madu Avatar asked Dec 20 '25 08:12

madu


1 Answers

Assuming you can access your site from both 127.0.0.1 and localhost, load the page via localhost and have that page access http://127.0.0.1. I can't guarantee this triggers cross-origin in all cases, but it was working for me with iframes.

like image 134
Chris Avatar answered Dec 23 '25 01:12

Chris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!