mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-27 20:46:51 -05:00
BytesLiteral.String
This commit is contained in:
parent
4dd771170c
commit
65d5c07533
@ -9,6 +9,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/v2ray/v2ray-core/common/log"
|
"github.com/v2ray/v2ray-core/common/log"
|
||||||
|
"github.com/v2ray/v2ray-core/common/serial"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -20,7 +21,7 @@ func (this *PortRange) UnmarshalJSON(data []byte) error {
|
|||||||
err := json.Unmarshal(data, &maybeint)
|
err := json.Unmarshal(data, &maybeint)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if maybeint <= 0 || maybeint >= 65535 {
|
if maybeint <= 0 || maybeint >= 65535 {
|
||||||
log.Error("Invalid port [", string(data), "]")
|
log.Error("Invalid port [", serial.BytesLiteral(data), "]")
|
||||||
return InvalidPortRange
|
return InvalidPortRange
|
||||||
}
|
}
|
||||||
this.From = Port(maybeint)
|
this.From = Port(maybeint)
|
||||||
|
@ -21,3 +21,7 @@ func (this BytesLiteral) Int64Value() int64 {
|
|||||||
int64(value[6])<<8 +
|
int64(value[6])<<8 +
|
||||||
int64(value[7])
|
int64(value[7])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this BytesLiteral) String() string {
|
||||||
|
return string(this.Value())
|
||||||
|
}
|
||||||
|
@ -14,6 +14,7 @@ import (
|
|||||||
"github.com/v2ray/v2ray-core/common/log"
|
"github.com/v2ray/v2ray-core/common/log"
|
||||||
v2net "github.com/v2ray/v2ray-core/common/net"
|
v2net "github.com/v2ray/v2ray-core/common/net"
|
||||||
"github.com/v2ray/v2ray-core/common/retry"
|
"github.com/v2ray/v2ray-core/common/retry"
|
||||||
|
"github.com/v2ray/v2ray-core/common/serial"
|
||||||
"github.com/v2ray/v2ray-core/transport/ray"
|
"github.com/v2ray/v2ray-core/transport/ray"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -222,7 +223,7 @@ func (this *HttpProxyServer) handlePlainHTTP(request *http.Request, dest v2net.D
|
|||||||
|
|
||||||
requestBuffer := alloc.NewBuffer().Clear() // Don't release this buffer as it is passed into a Packet.
|
requestBuffer := alloc.NewBuffer().Clear() // Don't release this buffer as it is passed into a Packet.
|
||||||
request.Write(requestBuffer)
|
request.Write(requestBuffer)
|
||||||
log.Debug("Request to remote:\n", string(requestBuffer.Value))
|
log.Debug("Request to remote:\n", serial.BytesLiteral(requestBuffer.Value))
|
||||||
|
|
||||||
packet := v2net.NewPacket(dest, requestBuffer, true)
|
packet := v2net.NewPacket(dest, requestBuffer, true)
|
||||||
ray := this.space.PacketDispatcher().DispatchToOutbound(packet)
|
ray := this.space.PacketDispatcher().DispatchToOutbound(packet)
|
||||||
|
Loading…
Reference in New Issue
Block a user