Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/omengye/Xray-core into minimal
Browse files Browse the repository at this point in the history
# Conflicts:
#	go.mod
#	go.sum
#	proxy/shadowsocks/shadowsocks.go
#	proxy/shadowsocks_2022/shadowsocks_2022.go
#	proxy/wireguard/wireguard.go
  • Loading branch information
omengye committed Sep 24, 2024
2 parents 45f4728 + aaa5425 commit fa47792
Show file tree
Hide file tree
Showing 82 changed files with 217 additions and 512 deletions.
2 changes: 0 additions & 2 deletions app/commander/commander.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package commander

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"net"
Expand Down
2 changes: 0 additions & 2 deletions app/dispatcher/default.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package dispatcher

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"regexp"
Expand Down
2 changes: 0 additions & 2 deletions app/dispatcher/dispatcher.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package dispatcher

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions app/dns/dns.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Package dns is an implementation of core.DNS feature.
package dns

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"fmt"
Expand Down
2 changes: 0 additions & 2 deletions app/dns/fakedns/fakedns.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package fakedns

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions app/log/command/command.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package command

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"

Expand Down
2 changes: 0 additions & 2 deletions app/log/log.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package log

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"fmt"
Expand Down
2 changes: 0 additions & 2 deletions app/observatory/burst/burst.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"time"
)

//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen

const (
rttFailed = time.Duration(math.MaxInt64 - iota)
rttUntested
Expand Down
2 changes: 0 additions & 2 deletions app/observatory/observatory.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package observatory

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions app/policy/policy.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
// Package policy is an implementation of policy.Manager feature.
package policy

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions app/proxyman/command/doc.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package command

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions app/proxyman/inbound/inbound.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package inbound

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"sync"
Expand Down
2 changes: 0 additions & 2 deletions app/proxyman/outbound/outbound.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package outbound

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"sort"
Expand Down
2 changes: 0 additions & 2 deletions app/reverse/reverse.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package reverse

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"

Expand Down
2 changes: 0 additions & 2 deletions app/router/command/command.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package command

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"time"
Expand Down
2 changes: 0 additions & 2 deletions app/router/router.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package router

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
sync "sync"
Expand Down
2 changes: 0 additions & 2 deletions app/stats/command/command.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package command

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"runtime"
Expand Down
2 changes: 0 additions & 2 deletions app/stats/stats.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package stats

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"sync"
Expand Down
2 changes: 0 additions & 2 deletions common/buf/buf.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
// Package buf provides a light-weight memory allocation mechanism.
package buf // import "github.com/xtls/xray-core/common/buf"

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (
"github.com/xtls/xray-core/common/errors"
)

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

// ErrNoClue is for the situation that existing information is not enough to make a decision. For example, Router may return this error when there is no suitable route.
var ErrNoClue = errors.New("not enough information for making a decision")

Expand Down
2 changes: 0 additions & 2 deletions common/crypto/crypto.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
// Package crypto provides common crypto libraries for Xray.
package crypto // import "github.com/xtls/xray-core/common/crypto"

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions common/drain/drain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package drain

import "io"

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

type Drainer interface {
AcknowledgeReceive(size int)
Drain(reader io.Reader) error
Expand Down
9 changes: 9 additions & 0 deletions common/errors/feature_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ import (
"context"
)

// PrintMigrateFeatureInfo prints a notice of the upcoming feature migration.
// Place it after the source feature related config file pharser code.
// Important note: Only use this when the target migrating feature is under construction.
// Important note: Even when the target migrating feature has finished its construction, this notice can still be used yet before announcing deprecation of the old feature.
// Do not remove this function even there is no reference to it.
func PrintMigrateFeatureInfo(sourceFeature string, targetFeature string) {
LogInfo(context.Background(), "The feature " + sourceFeature + " will be migrated to " + targetFeature + " in the future.")
}

// PrintDeprecatedFeatureWarning prints a warning for deprecated and going to be removed feature.
// Do not remove this function even there is no reference to it.
func PrintDeprecatedFeatureWarning(feature string, migrateFeature string) {
Expand Down
2 changes: 0 additions & 2 deletions common/mux/mux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package mux

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions common/net/net.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
// Package net is a drop-in replacement to Golang's net package, with some more functionalities.
package net // import "github.com/xtls/xray-core/common/net"

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
17 changes: 6 additions & 11 deletions common/net/network.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion common/net/network.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ option java_multiple_files = true;
enum Network {
Unknown = 0;

RawTCP = 1 [deprecated = true];
TCP = 2;
UDP = 3;
UNIX = 4;
Expand Down
2 changes: 0 additions & 2 deletions common/platform/ctlcmd/ctlcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (
"github.com/xtls/xray-core/common/platform"
)

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

func Run(args []string, input io.Reader) (buf.MultiBuffer, error) {
xctl := platform.GetToolLocation("xctl")
if _, err := os.Stat(xctl); err != nil {
Expand Down
2 changes: 0 additions & 2 deletions common/protocol/protocol.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package protocol // import "github.com/xtls/xray-core/common/protocol"

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions common/protocol/tls/cert/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import (
"github.com/xtls/xray-core/common/errors"
)

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

type Certificate struct {
// certificate in ASN.1 DER format
Certificate []byte
Expand Down
2 changes: 0 additions & 2 deletions common/retry/retry.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package retry // import "github.com/xtls/xray-core/common/retry"

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"time"

Expand Down
2 changes: 0 additions & 2 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
// connections.
package core

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"fmt"
"runtime"
Expand Down
2 changes: 0 additions & 2 deletions features/routing/dns/context.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package dns

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"

Expand Down
2 changes: 0 additions & 2 deletions features/stats/stats.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package stats

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"

Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
golang.org/x/net v0.29.0
golang.org/x/sync v0.8.0
golang.org/x/sys v0.25.0
google.golang.org/grpc v1.66.2
google.golang.org/grpc v1.67.0
google.golang.org/protobuf v1.34.2
h12.io/socks v1.0.3
lukechampine.com/blake3 v1.3.0
Expand All @@ -45,7 +45,8 @@ require (
golang.org/x/mod v0.18.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
12 changes: 8 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,14 @@ golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo=
google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg=
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 h1:/jFs0duh4rdb8uIfPMv78iAJGcPKDeqAFnaLBropIC4=
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173/go.mod h1:tkCQ4FQXmpAgYVh++1cq16/dH4QJtmvpRv19DWGAHSA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
Expand Down
2 changes: 0 additions & 2 deletions infra/conf/conf.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package conf

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions infra/conf/serial/serial.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package serial

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions main/commands/all/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"github.com/xtls/xray-core/main/commands/base"
)

// go:generate go run github.com/xtls/xray-core/common/errors/errorgen

func init() {
base.RootCommand.Commands = append(
base.RootCommand.Commands,
Expand Down
2 changes: 0 additions & 2 deletions main/confloader/external/external.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package external

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"bytes"
"io"
Expand Down
2 changes: 0 additions & 2 deletions proxy/blackhole/blackhole.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Package blackhole is an outbound handler that blocks all connections.
package blackhole

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"time"
Expand Down
2 changes: 0 additions & 2 deletions proxy/dokodemo/dokodemo.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package dokodemo

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"sync/atomic"
Expand Down
2 changes: 0 additions & 2 deletions proxy/freedom/freedom.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package freedom

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"crypto/rand"
Expand Down
2 changes: 0 additions & 2 deletions proxy/http/http.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package http

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions proxy/loopback/config.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package loopback

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions proxy/socks/socks.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
// Package socks provides implements of Socks protocol 4, 4a and 5.
package socks

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions proxy/trojan/trojan.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package trojan

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
Loading

0 comments on commit fa47792

Please sign in to comment.