mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
Style: format code by gofumpt (#761)
This commit is contained in:
parent
d77be80b40
commit
e286cdcaa8
111 changed files with 293 additions and 291 deletions
|
@ -6,8 +6,7 @@ import (
|
|||
"github.com/xtls/xray-core/common"
|
||||
)
|
||||
|
||||
type SniffHeader struct {
|
||||
}
|
||||
type SniffHeader struct{}
|
||||
|
||||
func (h *SniffHeader) Protocol() string {
|
||||
return "bittorrent"
|
||||
|
|
|
@ -73,6 +73,7 @@ func printJSON(certificate *Certificate) {
|
|||
os.Stdout.Write(content)
|
||||
os.Stdout.WriteString("\n")
|
||||
}
|
||||
|
||||
func printFile(certificate *Certificate, name string) error {
|
||||
certPEM, keyPEM := certificate.ToPEM()
|
||||
return task.Run(context.Background(), func() error {
|
||||
|
@ -81,6 +82,7 @@ func printFile(certificate *Certificate, name string) error {
|
|||
return writeFile(keyPEM, name+"_key.pem")
|
||||
})
|
||||
}
|
||||
|
||||
func writeFile(content []byte, name string) error {
|
||||
f, err := os.Create(name)
|
||||
if err != nil {
|
||||
|
|
|
@ -20,8 +20,10 @@ func (h *SniffHeader) Domain() string {
|
|||
return h.domain
|
||||
}
|
||||
|
||||
var errNotTLS = errors.New("not TLS header")
|
||||
var errNotClientHello = errors.New("not client hello")
|
||||
var (
|
||||
errNotTLS = errors.New("not TLS header")
|
||||
errNotClientHello = errors.New("not client hello")
|
||||
)
|
||||
|
||||
func IsValidTLSVersion(major, minor byte) bool {
|
||||
return major == 3
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue