mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-13 20:28:32 +10:00
Compare commits
28 Commits
v1.8.0-rc.
...
v1.8.0-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0566ed9e22 | ||
|
|
9250c41aa2 | ||
|
|
c2b71dac82 | ||
|
|
bca531b6d2 | ||
|
|
2958e3b779 | ||
|
|
c85dddb704 | ||
|
|
773408f159 | ||
|
|
1c6a4111f1 | ||
|
|
d480353c49 | ||
|
|
10b7136b4d | ||
|
|
5d38d4f46b | ||
|
|
b74cbf4c60 | ||
|
|
dca899ca37 | ||
|
|
453f943614 | ||
|
|
23d5218377 | ||
|
|
566803da88 | ||
|
|
0b5743b8e0 | ||
|
|
c8bd736f9c | ||
|
|
bd8533d540 | ||
|
|
0fda6cd658 | ||
|
|
c952512f01 | ||
|
|
c77aae899c | ||
|
|
76c3092944 | ||
|
|
36b8fcd029 | ||
|
|
f5bb5cf343 | ||
|
|
3eed614dea | ||
|
|
76a295a660 | ||
|
|
082e3fb8df |
@@ -2,7 +2,7 @@
|
||||
icon: material/alert-decagram
|
||||
---
|
||||
|
||||
#### 1.8.0-rc.5
|
||||
#### 1.8.0-rc.6
|
||||
|
||||
* Fixes and improvements
|
||||
|
||||
|
||||
@@ -122,14 +122,18 @@ type ListenOptions struct {
|
||||
|
||||
type UDPTimeoutCompat Duration
|
||||
|
||||
func (u *UDPTimeoutCompat) UnmarshalJSON(data []byte) error {
|
||||
func (c UDPTimeoutCompat) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal((time.Duration)(c).String())
|
||||
}
|
||||
|
||||
func (c *UDPTimeoutCompat) UnmarshalJSON(data []byte) error {
|
||||
var valueNumber int64
|
||||
err := json.Unmarshal(data, &valueNumber)
|
||||
if err == nil {
|
||||
*u = UDPTimeoutCompat(time.Second * time.Duration(valueNumber))
|
||||
*c = UDPTimeoutCompat(time.Second * time.Duration(valueNumber))
|
||||
return nil
|
||||
}
|
||||
return json.Unmarshal(data, (*Duration)(u))
|
||||
return json.Unmarshal(data, (*Duration)(c))
|
||||
}
|
||||
|
||||
type ListenOptionsWrapper interface {
|
||||
|
||||
@@ -29,7 +29,7 @@ type Client struct {
|
||||
serverAddr M.Socksaddr
|
||||
transport http.RoundTripper
|
||||
http2 bool
|
||||
url *url.URL
|
||||
requestURL url.URL
|
||||
host []string
|
||||
method string
|
||||
headers http.Header
|
||||
@@ -81,6 +81,7 @@ func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, opt
|
||||
ctx: ctx,
|
||||
dialer: dialer,
|
||||
serverAddr: serverAddr,
|
||||
requestURL: requestURL,
|
||||
host: options.Host,
|
||||
method: options.Method,
|
||||
headers: options.Headers.Build(),
|
||||
@@ -105,7 +106,7 @@ func (c *Client) dialHTTP(ctx context.Context) (net.Conn, error) {
|
||||
|
||||
request := &http.Request{
|
||||
Method: c.method,
|
||||
URL: c.url,
|
||||
URL: &c.requestURL,
|
||||
Header: c.headers.Clone(),
|
||||
}
|
||||
switch hostLen := len(c.host); hostLen {
|
||||
@@ -125,7 +126,7 @@ func (c *Client) dialHTTP2(ctx context.Context) (net.Conn, error) {
|
||||
request := &http.Request{
|
||||
Method: c.method,
|
||||
Body: pipeInReader,
|
||||
URL: c.url,
|
||||
URL: &c.requestURL,
|
||||
Header: c.headers.Clone(),
|
||||
}
|
||||
request = request.WithContext(ctx)
|
||||
|
||||
Reference in New Issue
Block a user