mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-03 02:08:45 +00:00
chore: polish browserDialers xhttp runtime error client behavior
Agent-Logs-Url: https://github.com/XTLS/Xray-core/sessions/808be5b1-7ed2-4309-87f1-18a808d6aba4 Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
ca3cd5fb88
commit
1d13700481
@@ -44,7 +44,7 @@ type errorDialerClient struct {
|
|||||||
err error
|
err error
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *errorDialerClient) IsClosed() bool { return false }
|
func (c *errorDialerClient) IsClosed() bool { return true }
|
||||||
|
|
||||||
func (c *errorDialerClient) OpenStream(context.Context, string, string, io.Reader, bool) (io.ReadCloser, net.Addr, net.Addr, error) {
|
func (c *errorDialerClient) OpenStream(context.Context, string, string, io.Reader, bool) (io.ReadCloser, net.Addr, net.Addr, error) {
|
||||||
return nil, nil, nil, c.err
|
return nil, nil, nil, c.err
|
||||||
@@ -75,7 +75,7 @@ func getHTTPClient(ctx context.Context, dest net.Destination, streamSettings *in
|
|||||||
transportConfig := streamSettings.ProtocolSettings.(*Config)
|
transportConfig := streamSettings.ProtocolSettings.(*Config)
|
||||||
if transportConfig.Mode != "auto" && transportConfig.Mode != "packet-up" {
|
if transportConfig.Mode != "auto" && transportConfig.Mode != "packet-up" {
|
||||||
return &errorDialerClient{
|
return &errorDialerClient{
|
||||||
err: errors.New("dialerProxy/browserDialer with XHTTP only supports modes \"auto\" or \"packet-up\", got: \"", transportConfig.Mode, "\""),
|
err: errors.New("browserDialer with XHTTP only supports modes \"auto\" or \"packet-up\", got: \"", transportConfig.Mode, "\""),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
return &BrowserDialerClient{
|
return &BrowserDialerClient{
|
||||||
|
|||||||
Reference in New Issue
Block a user