mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-08-23 18:16:50 +08:00
XHTTP client: Move x_padding
into Referer
header (#4298)
""Breaking"": Update the server side first, then client
This commit is contained in:
@@ -5,13 +5,15 @@ import (
|
||||
"io"
|
||||
gonet "net"
|
||||
|
||||
"github.com/xtls/xray-core/common/errors"
|
||||
"github.com/xtls/xray-core/transport/internet/browser_dialer"
|
||||
"github.com/xtls/xray-core/transport/internet/websocket"
|
||||
)
|
||||
|
||||
// implements splithttp.DialerClient in terms of browser dialer
|
||||
// has no fields because everything is global state :O)
|
||||
type BrowserDialerClient struct{}
|
||||
// BrowserDialerClient implements splithttp.DialerClient in terms of browser dialer
|
||||
type BrowserDialerClient struct {
|
||||
transportConfig *Config
|
||||
}
|
||||
|
||||
func (c *BrowserDialerClient) IsClosed() bool {
|
||||
panic("not implemented yet")
|
||||
@@ -19,10 +21,10 @@ func (c *BrowserDialerClient) IsClosed() bool {
|
||||
|
||||
func (c *BrowserDialerClient) OpenStream(ctx context.Context, url string, body io.Reader, uploadOnly bool) (io.ReadCloser, gonet.Addr, gonet.Addr, error) {
|
||||
if body != nil {
|
||||
panic("not implemented yet")
|
||||
return nil, nil, nil, errors.New("bidirectional streaming for browser dialer not implemented yet")
|
||||
}
|
||||
|
||||
conn, err := browser_dialer.DialGet(url)
|
||||
conn, err := browser_dialer.DialGet(url, c.transportConfig.GetRequestHeader())
|
||||
dummyAddr := &gonet.IPAddr{}
|
||||
if err != nil {
|
||||
return nil, dummyAddr, dummyAddr, err
|
||||
@@ -37,7 +39,7 @@ func (c *BrowserDialerClient) PostPacket(ctx context.Context, url string, body i
|
||||
return err
|
||||
}
|
||||
|
||||
err = browser_dialer.DialPost(url, bytes)
|
||||
err = browser_dialer.DialPost(url, c.transportConfig.GetRequestHeader(), bytes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user