Compare commits

...

3 Commits

Author SHA1 Message Date
RPRX
1bf3a632ca v1.7.2 2023-01-07 17:51:40 +00:00
RPRX
ff5ce767df Revert "add file soft link path resolve support (#1482)" (#1495)
This reverts commit eaf401eda9.
2023-01-07 15:11:23 +00:00
RPRX
8c0d3c0257 XTLS Vision supports acceptProxyProtocol (test needed)
Fixes https://github.com/XTLS/Xray-core/issues/1339
2023-01-07 11:01:53 +00:00
4 changed files with 9 additions and 13 deletions

View File

@@ -3,7 +3,7 @@ package filesystem
import (
"io"
"os"
"path/filepath"
"github.com/xtls/xray-core/common/buf"
"github.com/xtls/xray-core/common/platform"
)
@@ -11,11 +11,7 @@ import (
type FileReaderFunc func(path string) (io.ReadCloser, error)
var NewFileReader FileReaderFunc = func(path string) (io.ReadCloser, error) {
resolved_path,err:=filepath.EvalSymlinks(path)
if err!= nil{
return nil,err
}
return os.Open(resolved_path)
return os.Open(path)
}
func ReadFile(path string) ([]byte, error) {

View File

@@ -18,7 +18,7 @@ import (
)
var (
version = "1.7.1"
version = "1.7.2"
build = "Custom"
codename = "Xray, Penetrates Everything."
intro = "A unified platform for anti-censorship."

View File

@@ -2,7 +2,6 @@ package serial
import (
"io"
"path/filepath"
"github.com/xtls/xray-core/core"
"github.com/xtls/xray-core/infra/conf"
@@ -11,11 +10,7 @@ import (
func BuildConfig(files []string, formats []string) (*core.Config, error) {
cf := &conf.Config{}
for i, file_ := range files {
file, err := filepath.EvalSymlinks(file_)
if err != nil {
return nil, err
}
for i, file := range files {
newError("Reading config: ", file).AtInfo().WriteToLog()
r, err := confloader.LoadConfig(file)
if err != nil {

View File

@@ -13,6 +13,7 @@ import (
"time"
"unsafe"
"github.com/pires/go-proxyproto"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/buf"
"github.com/xtls/xray-core/common/errors"
@@ -471,6 +472,10 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
var p uintptr
if tlsConn, ok := iConn.(*tls.Conn); ok {
netConn = tlsConn.NetConn()
if pc, ok := netConn.(*proxyproto.Conn); ok {
netConn = pc.Raw()
// 8192 > 4096, there is no need to process pc's bufReader
}
if sc, ok := netConn.(syscall.Conn); ok {
rawConn, _ = sc.SyscallConn()
}