To run your react vite application as https://localhost:5173 instead of https://12.7.0.0.1:5173 you can modify the vite.config.js like this:

server: { https: true,host: true },

For Backend like Laravel, be sure to also use the LAN IP instead of the IP Address.

$ php artisan serve --host=0.0.0.0 --port=80

 

This is an example of my vite.config.js

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    host: 'localhost',
    port: 5173
  },  
  plugins: [react()],
})

This will allow you to access the vite react application from any computer in your local network. In my example, I wanted to access the app from my mobile phone to test the layout of the applicaiton on a cell phone by accessing the compuer's host name or the NAT IP address.

When you make the changes, you may see a message like this on the terminal, therefore, you know its working.

9:57:03 AM [vite] vite.config.js changed, restarting server...
9:57:03 AM [vite] server restarted.

  âžœ  Local:   https://localhost:5173/   
  âžœ  Network: https://192.168.1.64:5173/
  âžœ  Network: https://192.168.56.1:5173/
  âžœ  Network: https://192.168.10.1:5173/

More information can be found here: https://vitejs.dev/config/server-options.html