Search code examples
laravelvagranthomestead

Homestead - accessing via http://localhost:PORT


Does anyone know if there is a way to resolve http://localhost:PORT to a project that is running on homestead. so traditionally you could just set up your desired address on host and Homestead.yaml as follow.

host

192.168.10.10 first.test
192.168.10.10 second.test

Homestead.yaml

ip: "192.168.10.10"
folders:
    ## first config
    - map: C:\Users\first
      to: /home/vagrant/first
    ## first config
    - map: C:\Users\second
      to: /home/vagrant/second
sites:
    ## first config
    - map: first.test
      to: /home/vagrant/first/public
      php: "7.1"    
    ## second config
    - map: second.test
      to: /home/vagrant/second/public
      php: "7.1"    

but when I want to use localhost:8082 or localhost:8083 instead of first.test and second.test It does't work.

side note: the reason I want to use localhost is because I have multiple projects and I'm working on laravel webpush and Service Workers requires HTTPS unless you are using localhost.

thanks


Solution

  • You need to enable https on homestead instead.

    Windows Mac