Skip to content

Commit

Permalink
moving sni and host extractor to separate package
Browse files Browse the repository at this point in the history
  • Loading branch information
uoosef committed Sep 3, 2023
1 parent 69893b7 commit 5eec8cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"bepass/doh"
"bepass/logger"
"bepass/resolve"
"bepass/sni"
"bepass/socks5"
"bepass/socks5/statute"
"bepass/transport"
Expand Down Expand Up @@ -59,9 +60,9 @@ type Server struct {

// getHostname This function extracts the tls sni or http
func (s *Server) getHostname(data []byte) ([]byte, []byte, error) {
hello, err := ReadClientHello(bytes.NewReader(data))
hello, err := sni.ReadClientHello(bytes.NewReader(data))
if err != nil {
host, data_, err := ParseHTTPHost(bytes.NewReader(data))
host, data_, err := sni.ParseHTTPHost(bytes.NewReader(data))
if err != nil {
return nil, data, err
}
Expand Down
2 changes: 1 addition & 1 deletion server/http.go → sni/http.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package server
package sni

import (
"bufio"
Expand Down
2 changes: 1 addition & 1 deletion server/tls.go → sni/tls.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package server
package sni

import (
"bytes"
Expand Down

0 comments on commit 5eec8cc

Please sign in to comment.