peterldowns / localias

custom local domain aliases for local dev servers
MIT License
583 stars 3 forks source link

fails to server over https://test #11

Closed gedw99 closed 1 year ago

gedw99 commented 1 year ago

daemon is running

via CLI i setup alias for "test: 8080"

localias debug config --print
# localias config file syntax
#
#       alias: port
#
# for example,
#
#   https://secure.test: 9000
#   http://insecure.test: 9001
#   insecure2.test: 9002
#   bareTLD: 9003
#
test: 8080

my little test server: go run .

package main

import (
    "fmt"
    "net/http"
)

func main() {
    fmt.Print("starting on port: 8080")

    http.HandleFunc("/", HelloServer)
    http.ListenAndServe(":8080", nil)
}

func HelloServer(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "Hello, %s!", r.URL.Path[1:])
}

test it:

url  http://localhost:8080/
Hello, !%                                          

test is via localias caddy proxy:

curl  https://test:443
curl: (6) Could not resolve host: test
curl  https://test 
curl: (6) Could not resolve host: test
peterldowns commented 1 year ago

I unfortunately cannot reproduce this problem using localias version 1.0.1 on MacOS 12.5.1 (arm). Here's a screenshot where I am running localias and your golang web server and successfully connecting to it

image

My first hypothesis is that you started the daemon, added the test: 8080 alias, but didn't reload or restart the daemon so it does not know about the alias. If this is the case, you should be able to fix the issue in one of these ways:

Then, running your curl https://test:443 or curl https://test commands.

If that doesn't work, can you please tell me:

peterldowns commented 1 year ago

Closing since I cannot reproduce this issue. I will re-open this if I can get enough information to reproduce the problem or others report the same thing.