Change localhost to another domain

How can I change the local webserver localhost to another domain?
If I start a Vaadin application, I will be directed to localhost:8080.

You deploy it behind a reverse proxy like Apache httpd or nginx

Can you describe how? I have never done this before.

You can probably search for a video on YouTube about it, it’s a bit long to explain in 1-2 sentences

I am already using VPN.

Why do you want to change that? What’s the use case?

I am coding the Webauthn registration flow. If an user clicks on a button, the Webauthn token should be registered on privacyIDEA. For this purpose I have written a simple web application with Vaadin which includes the button. It is important to know that in the context auf Webauthn Relying Party is an important concept. See here for more information https://webauthn.wtf/how-it-works/relying-party

If I set the rp (relying party) to my faculty domain (www.faculty-domain.com), Vaadin applications are always started with localhost:8080 as standard. I need to change this.

You can edit your hosts file and set a finding domain name for 127.0.0.1

https://docs.rackspace.com/docs/modify-your-hosts-file