简体   繁体   中英

How to redirect to localhost for any computer IP address with help of proxy? While redirecting, URL must not be changed

I have a web page with sign in with google option. This works perfectly when using http://localhost:8080 as it was added google console but sign in with google option doesn't work when using IP address. With help of proxy, when entering ip address in address bar, I wanted it to redirect to localhost without changing the url in address bar. Could someone tell me how to do it??? I need help Please...

As I understand, this is a task for you, then there should be some completion criteria specified for your task.

If you just need to demonstrate that it works locally on your machine, then you can simply register a name for your external IP in your local hosts file and use this name for redirection. See eg https://unix.stackexchange.com/questions/421491/what-is-the-purpose-of-etc-hosts on how to do this on Linux. A similar facility is available on Windows or macOS.

If you need to demonstrate that someone else on your network can log in to your application using your external IP, then you're out of luck. No locally running proxy will help you. You will need to publish your application on some hosting and provide it with a domain name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM