Compare commits

..

44 Commits

Author SHA1 Message Date
世界
7b7820a322
documentation: Bump version 2025-03-14 22:44:09 +08:00
世界
c38d3fb3b5
Fix DNS lookup context pollution 2025-03-14 22:39:33 +08:00
世界
b440c3371a
Fix http3 DNS server connecting to wrong address 2025-03-14 22:39:33 +08:00
Restia-Ashbell
228bdfa243
documentation: Fix typo 2025-03-14 22:39:33 +08:00
anytls
c13762f2b7
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-03-14 22:39:33 +08:00
k9982874
32b7fc91a5
Fix hosts DNS server 2025-03-14 22:39:32 +08:00
世界
07859befcd
Fix UDP DNS server crash 2025-03-14 22:39:32 +08:00
世界
ebff681aa7
documentation: Fix missing ip_accept_any DNS rule option 2025-03-14 22:39:32 +08:00
世界
011dd16efb
Fix anytls dialer usage 2025-03-14 22:39:31 +08:00
世界
d32a9f0f7c
Move predefined DNS server to rule action 2025-03-14 22:39:31 +08:00
世界
9295aba05a
Fix domain resolver on direct outbound 2025-03-14 22:39:31 +08:00
Zephyruso
8f0dc74b41
Fix missing AnyTLS display name 2025-03-14 22:39:31 +08:00
anytls
07475132c0
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-03-14 22:39:30 +08:00
Estel
1c85682f36
documentation: Fix typo
Signed-off-by: Estel <callmebedrockdigger@gmail.com>
2025-03-14 22:39:30 +08:00
TargetLocked
5b4dfea740
Fix parsing legacy DNS options 2025-03-14 22:39:30 +08:00
世界
e01712fd40
Fix DNS fallback 2025-03-14 22:39:30 +08:00
世界
0e98b5fe44
documentation: Fix missing hosts DNS server 2025-03-14 22:39:29 +08:00
anytls
b10037bb57
Add MinIdleSession option to AnyTLS outbound
Co-authored-by: anytls <anytls>
2025-03-14 22:39:29 +08:00
ReleTor
50bacf545b
documentation: Minor fixes 2025-03-14 22:39:29 +08:00
libtry486
5489daf126
documentation: Fix typo
fix typo

Signed-off-by: libtry486 <89328481+libtry486@users.noreply.github.com>
2025-03-14 22:39:28 +08:00
Alireza Ahmadi
b5f828ad84
Fix Outbound deadlock 2025-03-14 22:39:28 +08:00
世界
16f034037b
documentation: Fix AnyTLS doc 2025-03-14 22:39:27 +08:00
anytls
75f4a3d4a8
Add AnyTLS protocol 2025-03-14 22:39:27 +08:00
世界
69a6dc50f3
Migrate to stdlib ECH support 2025-03-14 22:39:27 +08:00
世界
40e24a440e
Add fallback local DNS server for iOS 2025-03-14 22:39:26 +08:00
世界
a4c3367c71
Get darwin local DNS server from libresolv 2025-03-14 22:39:26 +08:00
世界
abfebd1e96
Improve resolve action 2025-03-14 22:39:25 +08:00
世界
877988b3e9
Fix toolchain version 2025-03-14 22:39:25 +08:00
世界
f7c1ebd56d
Add back port hopping to hysteria 1 2025-03-14 22:39:25 +08:00
世界
a407c03497
Update dependencies 2025-03-14 22:39:25 +08:00
xchacha20-poly1305
474efa5585
Remove single quotes of raw Moziila certs 2025-03-14 22:39:24 +08:00
世界
6225ea1980
Add Tailscale endpoint 2025-03-14 22:39:24 +08:00
世界
aa6b2404ab
Build legacy binaries with latest Go 2025-03-14 22:39:24 +08:00
世界
4c59a3cf7c
documentation: Remove outdated icons 2025-03-14 22:39:23 +08:00
世界
9fd37c7b02
documentation: Certificate store 2025-03-14 22:39:23 +08:00
世界
b21a79bc12
documentation: TLS fragment 2025-03-14 22:39:23 +08:00
世界
d7d87436d7
documentation: Outbound domain resolver 2025-03-14 22:39:23 +08:00
世界
4f735529e5
documentation: Refactor DNS 2025-03-14 22:39:22 +08:00
世界
bca4b38fce
Add certificate store 2025-03-14 22:39:22 +08:00
世界
a8a5ae2e77
Add TLS fragment support 2025-03-14 22:39:22 +08:00
世界
8929b4161d
refactor: Outbound domain resolver 2025-03-14 22:39:22 +08:00
世界
6fb79d5d72
refactor: DNS 2025-03-14 22:39:22 +08:00
世界
96eb98c00a
Fix httpupgrade crash 2025-03-14 17:17:28 +08:00
世界
68ce9577c6
Fix context in v2ray http transports 2025-03-14 17:07:17 +08:00
6 changed files with 22 additions and 5 deletions

View File

@ -2,7 +2,7 @@
icon: material/alert-decagram
---
#### 1.12.0-alpha.15
#### 1.12.0-alpha.16
* Fixes and improvements

View File

@ -20,12 +20,16 @@ type ID struct {
}
func ContextWithNewID(ctx context.Context) context.Context {
return context.WithValue(ctx, (*idKey)(nil), ID{
return ContextWithID(ctx, ID{
ID: rand.Uint32(),
CreatedAt: time.Now(),
})
}
func ContextWithID(ctx context.Context, id ID) context.Context {
return context.WithValue(ctx, (*idKey)(nil), id)
}
func IDFromContext(ctx context.Context) (ID, bool) {
id, loaded := ctx.Value((*idKey)(nil)).(ID)
return id, loaded

View File

@ -2,6 +2,7 @@ package v2rayhttp
import (
std_bufio "bufio"
"context"
"io"
"net"
"net/http"
@ -10,6 +11,7 @@ import (
"sync"
"time"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing/common"
"github.com/sagernet/sing/common/baderror"
"github.com/sagernet/sing/common/buf"
@ -255,3 +257,11 @@ func (w *HTTP2ConnWrapper) Close() error {
func (w *HTTP2ConnWrapper) Upstream() any {
return w.ExtendedConn
}
func DupContext(ctx context.Context) context.Context {
id, loaded := log.IDFromContext(ctx)
if !loaded {
return context.Background()
}
return log.ContextWithID(context.Background(), id)
}

View File

@ -132,7 +132,7 @@ func (s *Server) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
if requestBody != nil {
conn = bufio.NewCachedConn(conn, requestBody)
}
s.handler.NewConnectionEx(request.Context(), conn, source, M.Socksaddr{}, nil)
s.handler.NewConnectionEx(DupContext(request.Context()), conn, source, M.Socksaddr{}, nil)
} else {
writer.WriteHeader(http.StatusOK)
done := make(chan struct{})

View File

@ -12,6 +12,7 @@ import (
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing-box/transport/v2rayhttp"
"github.com/sagernet/sing/common"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/logger"
@ -37,6 +38,7 @@ type Server struct {
func NewServer(ctx context.Context, logger logger.ContextLogger, options option.V2RayHTTPUpgradeOptions, tlsConfig tls.ServerConfig, handler adapter.V2RayServerTransportHandler) (*Server, error) {
server := &Server{
ctx: ctx,
logger: logger,
tlsConfig: tlsConfig,
handler: handler,
host: options.Host,
@ -110,7 +112,7 @@ func (s *Server) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
s.invalidRequest(writer, request, http.StatusInternalServerError, E.Cause(err, "hijack failed"))
return
}
s.handler.NewConnectionEx(request.Context(), conn, sHttp.SourceAddress(request), M.Socksaddr{}, nil)
s.handler.NewConnectionEx(v2rayhttp.DupContext(request.Context()), conn, sHttp.SourceAddress(request), M.Socksaddr{}, nil)
}
func (s *Server) invalidRequest(writer http.ResponseWriter, request *http.Request, statusCode int, err error) {

View File

@ -13,6 +13,7 @@ import (
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing-box/transport/v2rayhttp"
"github.com/sagernet/sing/common"
"github.com/sagernet/sing/common/buf"
"github.com/sagernet/sing/common/bufio"
@ -114,7 +115,7 @@ func (s *Server) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
if len(earlyData) > 0 {
conn = bufio.NewCachedConn(conn, buf.As(earlyData))
}
s.handler.NewConnectionEx(request.Context(), conn, source, M.Socksaddr{}, nil)
s.handler.NewConnectionEx(v2rayhttp.DupContext(request.Context()), conn, source, M.Socksaddr{}, nil)
}
func (s *Server) invalidRequest(writer http.ResponseWriter, request *http.Request, statusCode int, err error) {