-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x-pack/filebeat/input/httpjson: add support for http+{unix,npipe} sch…
…emes (#33610) No testing at this stage since test infrastructure assumes a TCP transport.
- Loading branch information
1 parent
e976233
commit a0e5a8e
Showing
7 changed files
with
97 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
// or more contributor license agreements. Licensed under the Elastic License; | ||
// you may not use this file except in compliance with the Elastic License. | ||
|
||
//go:build !windows | ||
|
||
package httpjson | ||
|
||
import ( | ||
"errors" | ||
"net" | ||
) | ||
|
||
// npipeDialer implements transport.Dialer. | ||
type npipeDialer struct { | ||
path string | ||
} | ||
|
||
func (npipeDialer) Dial(_, _ string) (net.Conn, error) { | ||
return nil, errors.New("named pipe only available on windows") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
// or more contributor license agreements. Licensed under the Elastic License; | ||
// you may not use this file except in compliance with the Elastic License. | ||
|
||
//go:build windows | ||
|
||
package httpjson | ||
|
||
import ( | ||
"net" | ||
"path/filepath" | ||
|
||
"github.com/Microsoft/go-winio" | ||
) | ||
|
||
// npipeDialer implements transport.Dialer to a constant named pipe path. | ||
type npipeDialer struct { | ||
path string | ||
} | ||
|
||
func (d npipeDialer) Dial(_, _ string) (net.Conn, error) { | ||
return winio.DialPipe(`\\.\pipe`+filepath.FromSlash(d.path), nil) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters