mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 09:18:34 +00:00
Fix typos (#3527)
This commit is contained in:
parent
c69d38ae82
commit
16de0937a8
39 changed files with 72 additions and 72 deletions
|
@ -243,7 +243,7 @@ func (w *VisionWriter) WriteMultiBuffer(mb buf.MultiBuffer) error {
|
|||
return w.Writer.WriteMultiBuffer(mb)
|
||||
}
|
||||
|
||||
// ReshapeMultiBuffer prepare multi buffer for padding stucture (max 21 bytes)
|
||||
// ReshapeMultiBuffer prepare multi buffer for padding structure (max 21 bytes)
|
||||
func ReshapeMultiBuffer(ctx context.Context, buffer buf.MultiBuffer) buf.MultiBuffer {
|
||||
needReshape := 0
|
||||
for _, b := range buffer {
|
||||
|
@ -278,7 +278,7 @@ func ReshapeMultiBuffer(ctx context.Context, buffer buf.MultiBuffer) buf.MultiBu
|
|||
return mb2
|
||||
}
|
||||
|
||||
// XtlsPadding add padding to eliminate length siganature during tls handshake
|
||||
// XtlsPadding add padding to eliminate length signature during tls handshake
|
||||
func XtlsPadding(b *buf.Buffer, command byte, userUUID *[]byte, longPadding bool, ctx context.Context) *buf.Buffer {
|
||||
var contentLen int32 = 0
|
||||
var paddingLen int32 = 0
|
||||
|
|
|
@ -26,7 +26,7 @@ const (
|
|||
type AuthType int32
|
||||
|
||||
const (
|
||||
// NO_AUTH is for anounymous authentication.
|
||||
// NO_AUTH is for anonymous authentication.
|
||||
AuthType_NO_AUTH AuthType = 0
|
||||
// PASSWORD is for username/password authentication.
|
||||
AuthType_PASSWORD AuthType = 1
|
||||
|
|
|
@ -17,7 +17,7 @@ message Account {
|
|||
|
||||
// AuthType is the authentication type of Socks proxy.
|
||||
enum AuthType {
|
||||
// NO_AUTH is for anounymous authentication.
|
||||
// NO_AUTH is for anonymous authentication.
|
||||
NO_AUTH = 0;
|
||||
// PASSWORD is for username/password authentication.
|
||||
PASSWORD = 1;
|
||||
|
|
|
@ -68,7 +68,7 @@ func TestReadUsernamePassword(t *testing.T) {
|
|||
t.Error("for input: ", testCase.Input, " expect username ", testCase.Username, " but actually ", username)
|
||||
}
|
||||
if testCase.Password != password {
|
||||
t.Error("for input: ", testCase.Input, " expect passowrd ", testCase.Password, " but actually ", password)
|
||||
t.Error("for input: ", testCase.Input, " expect password ", testCase.Password, " but actually ", password)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
In the sock implementation of * ray, UDP authentication is flawed and can be bypassed.
|
||||
Tracking a UDP connection may be a bit troublesome.
|
||||
Here is a simple solution.
|
||||
We creat a filter, add remote IP to the pool when it try to establish a UDP connection with auth.
|
||||
We create a filter, add remote IP to the pool when it try to establish a UDP connection with auth.
|
||||
And drop UDP packets from unauthorized IP.
|
||||
After discussion, we believe it is not necessary to add a timeout mechanism to this filter.
|
||||
*/
|
||||
|
|
|
@ -124,7 +124,7 @@ func (c *Client) Process(ctx context.Context, link *transport.Link, dialer inter
|
|||
return errors.New("failed to write A request payload").Base(err).AtWarning()
|
||||
}
|
||||
|
||||
// Flush; bufferWriter.WriteMultiBufer now is bufferWriter.writer.WriteMultiBuffer
|
||||
// Flush; bufferWriter.WriteMultiBuffer now is bufferWriter.writer.WriteMultiBuffer
|
||||
if err = bufferWriter.SetBuffered(false); err != nil {
|
||||
return errors.New("failed to flush payload").Base(err).AtWarning()
|
||||
}
|
||||
|
|
|
@ -223,14 +223,14 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
|||
cs := tlsConn.ConnectionState()
|
||||
name = cs.ServerName
|
||||
alpn = cs.NegotiatedProtocol
|
||||
errors.LogInfo(ctx, "realName = " + name)
|
||||
errors.LogInfo(ctx, "realAlpn = " + alpn)
|
||||
errors.LogInfo(ctx, "realName = "+name)
|
||||
errors.LogInfo(ctx, "realAlpn = "+alpn)
|
||||
} else if realityConn, ok := iConn.(*reality.Conn); ok {
|
||||
cs := realityConn.ConnectionState()
|
||||
name = cs.ServerName
|
||||
alpn = cs.NegotiatedProtocol
|
||||
errors.LogInfo(ctx, "realName = " + name)
|
||||
errors.LogInfo(ctx, "realAlpn = " + alpn)
|
||||
errors.LogInfo(ctx, "realName = "+name)
|
||||
errors.LogInfo(ctx, "realAlpn = "+alpn)
|
||||
}
|
||||
name = strings.ToLower(name)
|
||||
alpn = strings.ToLower(alpn)
|
||||
|
@ -295,7 +295,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
|||
}
|
||||
if k == '?' || k == ' ' {
|
||||
path = string(firstBytes[i:j])
|
||||
errors.LogInfo(ctx, "realPath = " + path)
|
||||
errors.LogInfo(ctx, "realPath = "+path)
|
||||
if pfb[path] == nil {
|
||||
path = ""
|
||||
}
|
||||
|
@ -524,7 +524,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
|||
clientReader = proxy.NewVisionReader(clientReader, trafficState, ctx1)
|
||||
err = encoding.XtlsRead(clientReader, serverWriter, timer, connection, input, rawInput, trafficState, nil, ctx1)
|
||||
} else {
|
||||
// from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBufer
|
||||
// from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBuffer
|
||||
err = buf.Copy(clientReader, serverWriter, buf.UpdateActivity(timer))
|
||||
}
|
||||
|
||||
|
@ -552,7 +552,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
|||
if err := clientWriter.WriteMultiBuffer(multiBuffer); err != nil {
|
||||
return err // ...
|
||||
}
|
||||
// Flush; bufferWriter.WriteMultiBufer now is bufferWriter.writer.WriteMultiBuffer
|
||||
// Flush; bufferWriter.WriteMultiBuffer now is bufferWriter.writer.WriteMultiBuffer
|
||||
if err := bufferWriter.SetBuffered(false); err != nil {
|
||||
return errors.New("failed to write A response payload").Base(err).AtWarning()
|
||||
}
|
||||
|
@ -561,7 +561,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
|||
if requestAddons.Flow == vless.XRV {
|
||||
err = encoding.XtlsWrite(serverReader, clientWriter, timer, connection, trafficState, nil, ctx)
|
||||
} else {
|
||||
// from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBufer
|
||||
// from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBuffer
|
||||
err = buf.Copy(serverReader, clientWriter, buf.UpdateActivity(timer))
|
||||
}
|
||||
if err != nil {
|
||||
|
|
|
@ -219,7 +219,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||
} else {
|
||||
errors.LogDebug(ctx, "Reader is not timeout reader, will send out vless header separately from first payload")
|
||||
}
|
||||
// Flush; bufferWriter.WriteMultiBufer now is bufferWriter.writer.WriteMultiBuffer
|
||||
// Flush; bufferWriter.WriteMultiBuffer now is bufferWriter.writer.WriteMultiBuffer
|
||||
if err := bufferWriter.SetBuffered(false); err != nil {
|
||||
return errors.New("failed to write A request payload").Base(err).AtWarning()
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||
ctx1 := session.ContextWithInbound(ctx, nil) // TODO enable splice
|
||||
err = encoding.XtlsWrite(clientReader, serverWriter, timer, conn, trafficState, ob, ctx1)
|
||||
} else {
|
||||
// from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBufer
|
||||
// from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBuffer
|
||||
err = buf.Copy(clientReader, serverWriter, buf.UpdateActivity(timer))
|
||||
}
|
||||
if err != nil {
|
||||
|
@ -276,7 +276,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||
if requestAddons.Flow == vless.XRV {
|
||||
err = encoding.XtlsRead(serverReader, clientWriter, timer, conn, input, rawInput, trafficState, ob, ctx)
|
||||
} else {
|
||||
// from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBufer
|
||||
// from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBuffer
|
||||
err = buf.Copy(serverReader, clientWriter, buf.UpdateActivity(timer))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue