Skip to content

Commit

Permalink
only support unix
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme committed Nov 8, 2023
1 parent e2a3057 commit caf7472
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
7 changes: 2 additions & 5 deletions config/confighttp/confighttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ type HTTPServerSettings struct {
Endpoint string `mapstructure:"endpoint"`

// Network configures the network associated with the server.
// The network must be "tcp", "tcp4", "tcp6", "unix" or "unixpacket".
// The network must be "tcp", "tcp4", "tcp6" or "unix".
Network string `mapstructure:"network"`

// TLSSetting struct exposes TLS client configuration.
Expand Down Expand Up @@ -250,9 +250,6 @@ func (hss *HTTPServerSettings) ToListener() (net.Listener, error) {
if network == "" {
network = "tcp"
}
if network == "http+unix" || network == "https+unix" || network == "unixpacket" {
network = "unix"
}
listener, err := net.Listen(network, hss.Endpoint)
if err != nil {
return nil, err
Expand All @@ -272,7 +269,7 @@ func (hss *HTTPServerSettings) ToListener() (net.Listener, error) {

func (hss *HTTPServerSettings) Validate() error {
switch hss.Network {
case "tcp", "tcp4", "tcp6", "unix", "unixpacket", "http+unix", "https+unix", "":
case "tcp", "tcp4", "tcp6", "unix", "":
default:
return fmt.Errorf("invalid network %q", hss.Network)
}
Expand Down
24 changes: 0 additions & 24 deletions config/confighttp/confighttp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1386,30 +1386,6 @@ func TestHTTPServerSettings_Validate(t *testing.T) {
},
nil,
},
{
"unixpacket",
&HTTPServerSettings{
Network: "unixpacket",
Endpoint: unixSocket,
},
nil,
},
{
"http+unix",
&HTTPServerSettings{
Network: "http+unix",
Endpoint: unixSocket,
},
nil,
},
{
"https+unix",
&HTTPServerSettings{
Network: "https+unix",
Endpoint: unixSocket,
},
nil,
},
{
"invalid",
&HTTPServerSettings{
Expand Down

0 comments on commit caf7472

Please sign in to comment.