Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
07f3ee7
header
Feb 5, 2026
3f05978
isTcp
Feb 5, 2026
9c02472
ReadFull
Feb 6, 2026
8f3a064
fix splice
Feb 6, 2026
59d1e02
infra
Feb 6, 2026
5c19456
test case & fix udp & raw close
Feb 7, 2026
88a1e26
fix dialer
Feb 7, 2026
f66ed82
1
Feb 7, 2026
37045b3
ServersError
Feb 9, 2026
1b390c9
errors
Feb 9, 2026
6e825f0
remove checksums
Feb 9, 2026
63796c6
Merge branch 'main' into header-custom
Feb 13, 2026
bc21e70
tcp custom header
Feb 13, 2026
1041f62
1
Feb 13, 2026
9fd3317
1
Feb 13, 2026
7b72f8e
udp custom header
Feb 13, 2026
caf4152
noise mask
Feb 13, 2026
91a18a1
fragment mask
Feb 13, 2026
7942479
fragment
Feb 13, 2026
7b4f819
refactor tcp custom header
Feb 13, 2026
5c3afcd
1
Feb 13, 2026
72abbd0
refactor udpmask readfrom
Feb 13, 2026
ecdcb61
addr log
Feb 13, 2026
e798392
noise applyto
Feb 13, 2026
327a018
ApplyTo
Feb 13, 2026
9ee4d93
noise reset logic
Feb 13, 2026
59bdbcc
v4udp
Feb 13, 2026
15c2e70
xhttp3 mask
Feb 13, 2026
b74c1ff
noise infra
Feb 13, 2026
2a93a98
fix infra
Feb 13, 2026
9542327
infra
Feb 14, 2026
0fd74b4
remove applyto
Feb 14, 2026
63d81e1
Splice
Feb 14, 2026
c0b7240
spliceable
Feb 14, 2026
5cc4ff2
spliceable
Feb 14, 2026
42b3bfa
better logic
Feb 14, 2026
432e5c5
fragment server
Feb 14, 2026
0d52f04
freedom
Feb 14, 2026
8347046
net.Error & net.ErrClosed & packet.addr
Feb 15, 2026
1f5490b
1
Feb 15, 2026
c5864f6
io.ErrShortBuffer
Feb 15, 2026
fc9842e
sync
Feb 15, 2026
af6f2b6
logdebug io.ErrShortBuffer
Feb 15, 2026
85c9f56
finalmask.UDPSize
Feb 15, 2026
7cd7cce
refactor xdns
Feb 15, 2026
0205fc1
refine spliceable
Feb 16, 2026
0596bf9
packet type & tcpCustomServerConn sendError
Feb 18, 2026
218edcd
fix infra
Feb 18, 2026
970f7aa
1
Feb 19, 2026
a1bd13e
tcp header: readSequence, writeSequence & remove 8192, header merged
Feb 19, 2026
bf2fab3
1
Feb 19, 2026
38f6a65
refactor udpmask
Feb 21, 2026
4e0a634
1
Feb 21, 2026
fe02453
refactor udpmask
Feb 21, 2026
cd81483
fix possible deadlock
Feb 22, 2026
48cd174
defer instead
Feb 22, 2026
59a1a30
io.ErrShortWrite
Feb 25, 2026
7ddbfe1
Refactor tcp mask manager
Feb 26, 2026
9a2fb33
UnwrapRawConn
Feb 26, 2026
a9426cf
NewTcpListener
Feb 26, 2026
1920a63
tcpListener
Feb 27, 2026
b5e5543
kcp AckList
Mar 2, 2026
21df8f3
limit = 1
Mar 2, 2026
466ce52
1
Mar 2, 2026
9424456
fix bug
Mar 2, 2026
03340f2
nil err for temp err
Mar 2, 2026
988ef9e
fix bug
Mar 2, 2026
3c0cb1d
all nil
Mar 2, 2026
0af9817
fix crash & enhance xdns
Mar 3, 2026
f9bc2da
q.last
Mar 3, 2026
8ab1b9d
10 * time.Second
Mar 3, 2026
5907e81
queue -> q
Mar 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions common/net/cnc/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,46 @@ import (
"github.com/xtls/xray-core/common/signal/done"
)

type ConnectionOption func(*connection)
type ConnectionOption func(*Connection)

func ConnectionLocalAddr(a net.Addr) ConnectionOption {
return func(c *connection) {
return func(c *Connection) {
c.local = a
}
}

func ConnectionRemoteAddr(a net.Addr) ConnectionOption {
return func(c *connection) {
return func(c *Connection) {
c.remote = a
}
}

func ConnectionInput(writer io.Writer) ConnectionOption {
return func(c *connection) {
return func(c *Connection) {
c.writer = buf.NewWriter(writer)
}
}

func ConnectionInputMulti(writer buf.Writer) ConnectionOption {
return func(c *connection) {
return func(c *Connection) {
c.writer = writer
}
}

func ConnectionOutput(reader io.Reader) ConnectionOption {
return func(c *connection) {
return func(c *Connection) {
c.reader = &buf.BufferedReader{Reader: buf.NewReader(reader)}
}
}

func ConnectionOutputMulti(reader buf.Reader) ConnectionOption {
return func(c *connection) {
return func(c *Connection) {
c.reader = &buf.BufferedReader{Reader: reader}
}
}

func ConnectionOutputMultiUDP(reader buf.Reader) ConnectionOption {
return func(c *connection) {
return func(c *Connection) {
c.reader = &buf.BufferedReader{
Reader: reader,
Splitter: buf.SplitFirstBytes,
Expand All @@ -58,13 +58,13 @@ func ConnectionOutputMultiUDP(reader buf.Reader) ConnectionOption {
}

func ConnectionOnClose(n io.Closer) ConnectionOption {
return func(c *connection) {
return func(c *Connection) {
c.onClose = n
}
}

func NewConnection(opts ...ConnectionOption) net.Conn {
c := &connection{
c := &Connection{
done: done.New(),
local: &net.TCPAddr{
IP: []byte{0, 0, 0, 0},
Expand All @@ -83,7 +83,7 @@ func NewConnection(opts ...ConnectionOption) net.Conn {
return c
}

type connection struct {
type Connection struct {
reader *buf.BufferedReader
writer buf.Writer
done *done.Instance
Expand All @@ -92,17 +92,17 @@ type connection struct {
remote net.Addr
}

func (c *connection) Read(b []byte) (int, error) {
func (c *Connection) Read(b []byte) (int, error) {
return c.reader.Read(b)
}

// ReadMultiBuffer implements buf.Reader.
func (c *connection) ReadMultiBuffer() (buf.MultiBuffer, error) {
func (c *Connection) ReadMultiBuffer() (buf.MultiBuffer, error) {
return c.reader.ReadMultiBuffer()
}

// Write implements net.Conn.Write().
func (c *connection) Write(b []byte) (int, error) {
func (c *Connection) Write(b []byte) (int, error) {
if c.done.Done() {
return 0, io.ErrClosedPipe
}
Expand All @@ -113,7 +113,7 @@ func (c *connection) Write(b []byte) (int, error) {
return l, c.writer.WriteMultiBuffer(mb)
}

func (c *connection) WriteMultiBuffer(mb buf.MultiBuffer) error {
func (c *Connection) WriteMultiBuffer(mb buf.MultiBuffer) error {
if c.done.Done() {
buf.ReleaseMulti(mb)
return io.ErrClosedPipe
Expand All @@ -123,7 +123,7 @@ func (c *connection) WriteMultiBuffer(mb buf.MultiBuffer) error {
}

// Close implements net.Conn.Close().
func (c *connection) Close() error {
func (c *Connection) Close() error {
common.Must(c.done.Close())
common.Interrupt(c.reader)
common.Close(c.writer)
Expand All @@ -135,26 +135,26 @@ func (c *connection) Close() error {
}

// LocalAddr implements net.Conn.LocalAddr().
func (c *connection) LocalAddr() net.Addr {
func (c *Connection) LocalAddr() net.Addr {
return c.local
}

// RemoteAddr implements net.Conn.RemoteAddr().
func (c *connection) RemoteAddr() net.Addr {
func (c *Connection) RemoteAddr() net.Addr {
return c.remote
}

// SetDeadline implements net.Conn.SetDeadline().
func (c *connection) SetDeadline(t time.Time) error {
func (c *Connection) SetDeadline(t time.Time) error {
return nil
}

// SetReadDeadline implements net.Conn.SetReadDeadline().
func (c *connection) SetReadDeadline(t time.Time) error {
func (c *Connection) SetReadDeadline(t time.Time) error {
return nil
}

// SetWriteDeadline implements net.Conn.SetWriteDeadline().
func (c *connection) SetWriteDeadline(t time.Time) error {
func (c *Connection) SetWriteDeadline(t time.Time) error {
return nil
}
2 changes: 1 addition & 1 deletion infra/conf/freedom.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
v2net "github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/common/protocol"
"github.com/xtls/xray-core/proxy/freedom"
"google.golang.org/protobuf/proto"
"github.com/xtls/xray-core/transport/internet"
"google.golang.org/protobuf/proto"
)

type FreedomConfig struct {
Expand Down
Loading