Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to server over https://test #11

Closed
gedw99 opened this issue Jul 21, 2023 · 2 comments
Closed

fails to server over https://test #11

gedw99 opened this issue Jul 21, 2023 · 2 comments
Labels
needs-more-info needs more information from the reporter server related to the server / core logic

Comments

@gedw99
Copy link

gedw99 commented Jul 21, 2023

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:

```sh
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
Copy link
Owner

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:

  • Stop the daemon and run localias in the foreground, localias daemon stop && localias runcommand.
  • Reload the daemon localias daemon reload
  • Restart the daemon entirely localias daemon stop && localias daemon start

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

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

  • What operating system and architecture this is running on
  • How you installed localias and what version you're using (localias version)
  • The result of localias hostctl list (maybe Localias was unable to edit your /etc/hosts file to add the rule for test?)

@peterldowns peterldowns added bug something isn't working server related to the server / core logic needs-more-info needs more information from the reporter and removed bug something isn't working labels Jul 21, 2023
@peterldowns
Copy link
Owner

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.

@peterldowns peterldowns closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-more-info needs more information from the reporter server related to the server / core logic
Projects
None yet
Development

No branches or pull requests

2 participants