Skip to content

Replace devd.io with localhost for local routing#129

Open
chebread wants to merge 1 commit intocortesi:masterfrom
chebread:fix-devd-io-issue
Open

Replace devd.io with localhost for local routing#129
chebread wants to merge 1 commit intocortesi:masterfrom
chebread:fix-devd-io-issue

Conversation

@chebread
Copy link

Fixes #128

Problem:
The default domain devd.io no longer resolves to a local address (127.0.0.1).

Solution:
Replaced devd.io with localhost (and *.localhost) as the default domain for virtual hosting. According to RFC 6761, *.localhost is universally recognized and guaranteed to resolve to the loopback address locally in all operating systems and modern browsers, removing the dependency on external DNS.

Changes:

  • Changed template.DNSNames from devd.io to localhost in certgen.go
  • Updated default domain constants in routespec.go
  • Updated routing fallback logic in server.go
  • Updated test cases in route_test.go and server_test.go
  • Updated README.md to reflect the new localhost behavior

This commit changes the default virtual hosting domain from devd.io to  localhost (and *.localhost).

Resolves cortesi#128
This was referenced Mar 21, 2026
@wader
Copy link
Collaborator

wader commented Mar 21, 2026

Does TestServeFileWithContentEncoding fail for you also? probably depend on go version, i have a fix here #124

$ go test ./... -run TestServeFileWithContentEncoding
...
--- FAIL: TestServeFileWithContentEncoding (0.01s)
    fileserver_test.go:405: Content-Length mismatch: got 11, want -1
...

Copy link
Collaborator

@wader wader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

"testing"

"github.com/GeertJohan/go.rice"
rice "github.com/GeertJohan/go.rice"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go fmt wants it this way? i guess this can be cleaned up eventually if wader@283f73d can be merged

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using Go version 1.26.0 darwin/arm64. On March 21 at 20:00 KST, I cloned the devd repository from GitHub and ran (tested) gofmt in the route_test.go file. I found that the rice code was added by gofmt, not by me!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@wader
Copy link
Collaborator

wader commented Mar 21, 2026

Also would be great to fix CI, i have a PR to start moving to github actions

@cortesi Ok for you if we start merge stuff? i think we might need help to enable github action if i remember correctly

@chebread
Copy link
Author

Does TestServeFileWithContentEncoding fail for you also? probably depend on go version, i have a fix here #124

$ go test ./... -run TestServeFileWithContentEncoding
...
--- FAIL: TestServeFileWithContentEncoding (0.01s)
    fileserver_test.go:405: Content-Length mismatch: got 11, want -1
...

I also encountered the same error as you when I ran go test. However, when I used the code you resolved in #124 (w.(http.Flusher).Flush()), the bug did not occur when I ran go test.

@chebread
Copy link
Author

Also would be great to fix CI, i have a PR to start moving to github actions

@cortesi Ok for you if we start merge stuff? i think we might need help to enable github action if i remember correctly

I agree with that as well.

@wader
Copy link
Collaborator

wader commented Mar 21, 2026

@chebread Let's wait a bit and see if @cortesi shows up, if not i think we start merge and fix things

@chebread
Copy link
Author

@chebread Let's wait a bit and see if @cortesi shows up, if not i think we start merge and fix things

Sounds good. I'll be waiting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to run server using devd

2 participants