diff --git a/infra/conf/jsonpb/jsonpb.go b/infra/conf/jsonpb/jsonpb.go index d7ca651d8..c674db095 100644 --- a/infra/conf/jsonpb/jsonpb.go +++ b/infra/conf/jsonpb/jsonpb.go @@ -64,7 +64,7 @@ func init() { } return loadJSONPB(bytes.NewReader(data)) default: - return nil, newError("unknow type") + return nil, newError("unknown type") } }, })) diff --git a/infra/conf/merge/merge.go b/infra/conf/merge/merge.go index 0d2cccd00..abac771cb 100644 --- a/infra/conf/merge/merge.go +++ b/infra/conf/merge/merge.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. /* -Package merge provides the capbility to merge multiple +Package merge provides the capability to merge multiple JSON files or contents into one output. Merge Rules: diff --git a/infra/conf/mergers/merge.go b/infra/conf/mergers/merge.go index c2b041635..d89399421 100644 --- a/infra/conf/mergers/merge.go +++ b/infra/conf/mergers/merge.go @@ -58,7 +58,7 @@ func Merge(input interface{}, m map[string]interface{}) error { return err } default: - return newError("unknow merge input type") + return newError("unknown merge input type") } return nil } diff --git a/infra/conf/mergers/merger_base.go b/infra/conf/mergers/merger_base.go index 72a40d0cc..aa9987e37 100644 --- a/infra/conf/mergers/merger_base.go +++ b/infra/conf/mergers/merger_base.go @@ -52,7 +52,7 @@ func makeToJSONMergeFunc(converter func(v []byte) ([]byte, error)) MergeFunc { return err } default: - return newError("unknow merge input type") + return newError("unknown merge input type") } return nil } diff --git a/infra/conf/synthetic/router/router_strategy.go b/infra/conf/synthetic/router/router_strategy.go index bcbc13b83..736d52a2f 100644 --- a/infra/conf/synthetic/router/router_strategy.go +++ b/infra/conf/synthetic/router/router_strategy.go @@ -34,7 +34,7 @@ type strategyLeastLoadConfig struct { Baselines []duration.Duration `json:"baselines,omitempty"` // expected nodes count to select Expected int32 `json:"expected,omitempty"` - // max acceptable rtt, filter away high delay nodes. defalut 0 + // max acceptable rtt, filter away high delay nodes. default 0 MaxRTT duration.Duration `json:"maxRTT,omitempty"` // acceptable failure rate Tolerance float64 `json:"tolerance,omitempty"` diff --git a/infra/conf/v2jsonpb/v2jsonpb.go b/infra/conf/v2jsonpb/v2jsonpb.go index cf8b2b597..1efe913b1 100644 --- a/infra/conf/v2jsonpb/v2jsonpb.go +++ b/infra/conf/v2jsonpb/v2jsonpb.go @@ -63,7 +63,7 @@ func init() { } return loadV2JsonPb(data) default: - return nil, newError("unknow type") + return nil, newError("unknown type") } }, })) diff --git a/proxy/http/server.go b/proxy/http/server.go index eb4316c11..795e1a16f 100644 --- a/proxy/http/server.go +++ b/proxy/http/server.go @@ -260,7 +260,7 @@ func (s *Server) handlePlainHTTP(ctx context.Context, request *http.Request, wri return err } - // Plain HTTP request is not a stream. The request always finishes before response. Hense request has to be closed later. + // Plain HTTP request is not a stream. The request always finishes before response. Hence, request has to be closed later. defer common.Close(link.Writer) var result error = errWaitAnother diff --git a/proxy/shadowsocks/client.go b/proxy/shadowsocks/client.go index 96a5a2752..07efbed00 100644 --- a/proxy/shadowsocks/client.go +++ b/proxy/shadowsocks/client.go @@ -18,7 +18,7 @@ import ( "github.com/v2fly/v2ray-core/v4/transport/internet" ) -// Client is a inbound handler for Shadowsocks protocol +// Client is an inbound handler for Shadowsocks protocol type Client struct { serverPicker protocol.ServerPicker policyManager policy.Manager diff --git a/proxy/socks/config.proto b/proxy/socks/config.proto index 050a95401..68b814b46 100644 --- a/proxy/socks/config.proto +++ b/proxy/socks/config.proto @@ -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; diff --git a/proxy/socks/protocol_test.go b/proxy/socks/protocol_test.go index 7a9d9f280..83548f839 100644 --- a/proxy/socks/protocol_test.go +++ b/proxy/socks/protocol_test.go @@ -69,7 +69,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) } } } diff --git a/proxy/trojan/client.go b/proxy/trojan/client.go index c6246e34d..0c0622305 100644 --- a/proxy/trojan/client.go +++ b/proxy/trojan/client.go @@ -18,7 +18,7 @@ import ( "github.com/v2fly/v2ray-core/v4/transport/internet" ) -// Client is a inbound handler for trojan protocol +// Client is an inbound handler for trojan protocol type Client struct { serverPicker protocol.ServerPicker policyManager policy.Manager @@ -103,7 +103,7 @@ func (c *Client) Process(ctx context.Context, link *transport.Link, dialer inter return newError("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 newError("failed to flush payload").Base(err).AtWarning() } diff --git a/proxy/vless/inbound/inbound.go b/proxy/vless/inbound/inbound.go index 22e2823b0..da9416f1f 100644 --- a/proxy/vless/inbound/inbound.go +++ b/proxy/vless/inbound/inbound.go @@ -400,7 +400,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i // default: clientReader := reader clientReader := encoding.DecodeBodyAddons(reader, request, requestAddons) - // from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBufer + // from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBuffer if err := buf.Copy(clientReader, serverWriter, buf.UpdateActivity(timer)); err != nil { return newError("failed to transfer request payload").Base(err).AtInfo() } @@ -428,12 +428,12 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i } } - // Flush; bufferWriter.WriteMultiBufer now is bufferWriter.writer.WriteMultiBuffer + // Flush; bufferWriter.WriteMultiBuffer now is bufferWriter.writer.WriteMultiBuffer if err := bufferWriter.SetBuffered(false); err != nil { return newError("failed to write A response payload").Base(err).AtWarning() } - // from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBufer + // from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBuffer if err := buf.Copy(serverReader, clientWriter, buf.UpdateActivity(timer)); err != nil { return newError("failed to transfer response payload").Base(err).AtInfo() } diff --git a/proxy/vless/outbound/outbound.go b/proxy/vless/outbound/outbound.go index 1a1e00a89..0fccb0c62 100644 --- a/proxy/vless/outbound/outbound.go +++ b/proxy/vless/outbound/outbound.go @@ -143,12 +143,12 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte 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 newError("failed to write A request payload").Base(err).AtWarning() } - // from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBufer + // from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBuffer if err := buf.Copy(clientReader, serverWriter, buf.UpdateActivity(timer)); err != nil { return newError("failed to transfer request payload").Base(err).AtInfo() } @@ -167,7 +167,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte // default: serverReader := buf.NewReader(conn) serverReader := encoding.DecodeBodyAddons(conn, request, responseAddons) - // from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBufer + // from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBuffer if err := buf.Copy(serverReader, clientWriter, buf.UpdateActivity(timer)); err != nil { return newError("failed to transfer response payload").Base(err).AtInfo() }