From 16544c18aba5594be57f588c7d7f5ed294940e22 Mon Sep 17 00:00:00 2001 From: RPRX <63339210+rprx@users.noreply.github.com> Date: Fri, 4 Dec 2020 09:36:16 +0800 Subject: [PATCH] v1.1.0 --- app/commander/commander.go | 10 +- app/commander/config.pb.go | 14 +- app/commander/config.proto | 2 +- app/commander/errors.generated.go | 2 +- app/commander/outbound.go | 8 +- app/commander/service.go | 2 +- app/dispatcher/config.pb.go | 12 +- app/dispatcher/config.proto | 2 +- app/dispatcher/default.go | 30 ++-- app/dispatcher/dispatcher.go | 2 +- app/dispatcher/errors.generated.go | 2 +- app/dispatcher/sniffer.go | 8 +- app/dispatcher/stats.go | 6 +- app/dispatcher/stats_test.go | 6 +- app/dns/config.pb.go | 13 +- app/dns/config.proto | 2 +- app/dns/dns.go | 2 +- app/dns/dnscommon.go | 8 +- app/dns/dnscommon_test.go | 4 +- app/dns/dohdns.go | 18 +- app/dns/errors.generated.go | 2 +- app/dns/hosts.go | 8 +- app/dns/hosts_test.go | 6 +- app/dns/nameserver.go | 4 +- app/dns/nameserver_test.go | 4 +- app/dns/server.go | 24 +-- app/dns/server_test.go | 26 +-- app/dns/udpns.go | 20 +-- app/log/command/command.go | 8 +- app/log/command/command_test.go | 18 +- app/log/command/config.pb.go | 12 +- app/log/command/config.proto | 2 +- app/log/command/config_grpc.pb.go | 14 ++ app/log/command/errors.generated.go | 2 +- app/log/config.pb.go | 12 +- app/log/config.proto | 2 +- app/log/errors.generated.go | 2 +- app/log/log.go | 6 +- app/log/log_creator.go | 4 +- app/log/log_test.go | 8 +- app/policy/config.go | 2 +- app/policy/config.pb.go | 10 +- app/policy/config.proto | 2 +- app/policy/errors.generated.go | 2 +- app/policy/manager.go | 4 +- app/policy/manager_test.go | 6 +- app/policy/policy.go | 2 +- app/proxyman/command/command.go | 10 +- app/proxyman/command/command.pb.go | 18 +- app/proxyman/command/command.proto | 2 +- app/proxyman/command/command_grpc.pb.go | 34 ++++ app/proxyman/command/doc.go | 2 +- app/proxyman/command/errors.generated.go | 2 +- app/proxyman/config.pb.go | 18 +- app/proxyman/config.proto | 2 +- app/proxyman/inbound/always.go | 22 +-- app/proxyman/inbound/dynamic.go | 16 +- app/proxyman/inbound/errors.generated.go | 2 +- app/proxyman/inbound/inbound.go | 14 +- app/proxyman/inbound/worker.go | 56 +++--- app/proxyman/outbound/errors.generated.go | 2 +- app/proxyman/outbound/handler.go | 28 +-- app/proxyman/outbound/handler_test.go | 18 +- app/proxyman/outbound/outbound.go | 12 +- app/reverse/bridge.go | 14 +- app/reverse/config.go | 2 +- app/reverse/config.pb.go | 11 +- app/reverse/config.proto | 2 +- app/reverse/errors.generated.go | 2 +- app/reverse/portal.go | 18 +- app/reverse/portal_test.go | 4 +- app/reverse/reverse.go | 14 +- app/router/balancing.go | 4 +- app/router/command/command.go | 10 +- app/router/command/command.pb.go | 15 +- app/router/command/command.proto | 2 +- app/router/command/command_grpc.pb.go | 20 +++ app/router/command/command_test.go | 14 +- app/router/command/config.go | 4 +- app/router/command/errors.generated.go | 2 +- app/router/condition.go | 6 +- app/router/condition_geoip.go | 2 +- app/router/condition_geoip_test.go | 10 +- app/router/condition_test.go | 22 +-- app/router/config.go | 6 +- app/router/config.pb.go | 12 +- app/router/config.proto | 2 +- app/router/errors.generated.go | 2 +- app/router/router.go | 14 +- app/router/router_test.go | 14 +- app/stats/channel.go | 2 +- app/stats/channel_test.go | 6 +- app/stats/command/command.go | 12 +- app/stats/command/command.pb.go | 12 +- app/stats/command/command.proto | 2 +- app/stats/command/command_grpc.pb.go | 22 +++ app/stats/command/command_test.go | 6 +- app/stats/command/errors.generated.go | 2 +- app/stats/config.pb.go | 11 +- app/stats/config.proto | 2 +- app/stats/counter_test.go | 6 +- app/stats/errors.generated.go | 2 +- app/stats/stats.go | 8 +- app/stats/stats_test.go | 6 +- common/bitmask/byte_test.go | 2 +- common/buf/buf.go | 4 +- common/buf/buffer.go | 2 +- common/buf/buffer_test.go | 4 +- common/buf/copy.go | 4 +- common/buf/copy_test.go | 6 +- common/buf/errors.generated.go | 2 +- common/buf/io_test.go | 6 +- common/buf/multi_buffer.go | 6 +- common/buf/multi_buffer_test.go | 4 +- common/buf/reader.go | 4 +- common/buf/reader_test.go | 6 +- common/buf/readv_reader.go | 2 +- common/buf/readv_test.go | 6 +- common/buf/writer.go | 4 +- common/buf/writer_test.go | 6 +- common/common.go | 4 +- common/common_test.go | 2 +- common/crypto/aes.go | 2 +- common/crypto/auth.go | 8 +- common/crypto/auth_test.go | 8 +- common/crypto/benchmark_test.go | 2 +- common/crypto/chacha20.go | 2 +- common/crypto/chacha20_test.go | 4 +- common/crypto/chunk.go | 4 +- common/crypto/chunk_test.go | 6 +- common/crypto/crypto.go | 4 +- common/crypto/errors.generated.go | 2 +- common/crypto/io.go | 2 +- common/dice/dice.go | 2 +- common/dice/dice_test.go | 2 +- common/errors.generated.go | 2 +- common/errors/errorgen/main.go | 2 +- common/errors/errors.go | 10 +- common/errors/errors_test.go | 8 +- common/interfaces.go | 2 +- common/log/access.go | 2 +- common/log/log.go | 4 +- common/log/log.pb.go | 10 +- common/log/log.proto | 2 +- common/log/log_test.go | 4 +- common/log/logger.go | 6 +- common/log/logger_test.go | 6 +- common/mux/client.go | 24 +-- common/mux/client_test.go | 16 +- common/mux/errors.generated.go | 2 +- common/mux/frame.go | 12 +- common/mux/frame_test.go | 8 +- common/mux/mux.go | 2 +- common/mux/mux_test.go | 12 +- common/mux/reader.go | 6 +- common/mux/server.go | 22 +-- common/mux/session.go | 6 +- common/mux/session_test.go | 2 +- common/mux/writer.go | 10 +- common/net/address.pb.go | 10 +- common/net/address.proto | 2 +- common/net/address_test.go | 2 +- common/net/connection.go | 6 +- common/net/destination.pb.go | 10 +- common/net/destination.proto | 2 +- common/net/destination_test.go | 2 +- common/net/errors.generated.go | 2 +- common/net/net.go | 4 +- common/net/network.pb.go | 10 +- common/net/network.proto | 2 +- common/net/port.pb.go | 11 +- common/net/port.proto | 2 +- common/net/port_test.go | 2 +- common/platform/ctlcmd/ctlcmd.go | 6 +- common/platform/ctlcmd/errors.generated.go | 2 +- common/platform/filesystem/file.go | 4 +- common/platform/platform.go | 2 +- common/platform/platform_test.go | 4 +- common/protocol/address.go | 8 +- common/protocol/address_test.go | 8 +- common/protocol/bittorrent/bittorrent.go | 2 +- common/protocol/dns/errors.generated.go | 2 +- common/protocol/dns/io.go | 6 +- common/protocol/errors.generated.go | 2 +- common/protocol/headers.go | 6 +- common/protocol/headers.pb.go | 12 +- common/protocol/headers.proto | 2 +- common/protocol/http/headers.go | 2 +- common/protocol/http/headers_test.go | 6 +- common/protocol/http/sniff.go | 4 +- common/protocol/http/sniff_test.go | 2 +- common/protocol/id.go | 4 +- common/protocol/id_test.go | 4 +- common/protocol/protocol.go | 4 +- common/protocol/server_picker_test.go | 4 +- common/protocol/server_spec.go | 4 +- common/protocol/server_spec.pb.go | 14 +- common/protocol/server_spec.proto | 2 +- common/protocol/server_spec_test.go | 10 +- common/protocol/time.go | 2 +- common/protocol/time_test.go | 2 +- common/protocol/tls/cert/cert.go | 4 +- common/protocol/tls/cert/cert_test.go | 4 +- common/protocol/tls/cert/errors.generated.go | 2 +- common/protocol/tls/sniff.go | 2 +- common/protocol/tls/sniff_test.go | 2 +- common/protocol/udp/packet.go | 4 +- common/protocol/user.pb.go | 14 +- common/protocol/user.proto | 2 +- common/retry/errors.generated.go | 2 +- common/retry/retry.go | 4 +- common/retry/retry_test.go | 6 +- common/serial/serial_test.go | 6 +- common/serial/string_test.go | 2 +- common/serial/typed_message.pb.go | 12 +- common/serial/typed_message.proto | 2 +- common/serial/typed_message_test.go | 2 +- common/session/session.go | 12 +- common/signal/notifier_test.go | 2 +- common/signal/pubsub/pubsub.go | 6 +- common/signal/pubsub/pubsub_test.go | 2 +- common/signal/timer.go | 4 +- common/signal/timer_test.go | 2 +- common/strmatcher/benchmark_test.go | 4 +- common/strmatcher/domain_matcher_test.go | 2 +- common/strmatcher/full_matcher_test.go | 2 +- common/strmatcher/matchers_test.go | 4 +- common/strmatcher/strmatcher_test.go | 4 +- common/task/common.go | 2 +- common/task/periodic_test.go | 4 +- common/task/task.go | 2 +- common/task/task_test.go | 4 +- common/type_test.go | 2 +- common/uuid/uuid.go | 6 +- common/uuid/uuid_test.go | 4 +- core/config.go | 8 +- core/config.pb.go | 12 +- core/config.proto | 2 +- core/context_test.go | 2 +- core/core.go | 6 +- core/errors.generated.go | 2 +- core/functions.go | 8 +- core/functions_test.go | 18 +- core/mocks.go | 10 +- core/xray.go | 20 +-- core/xray_test.go | 30 ++-- features/dns/client.go | 8 +- features/dns/localdns/client.go | 4 +- features/errors.generated.go | 2 +- features/feature.go | 4 +- features/inbound/inbound.go | 6 +- features/outbound/outbound.go | 6 +- features/policy/policy.go | 4 +- features/routing/context.go | 2 +- features/routing/dispatcher.go | 6 +- features/routing/dns/context.go | 8 +- features/routing/dns/errors.generated.go | 2 +- features/routing/router.go | 4 +- features/routing/session/context.go | 6 +- features/stats/errors.generated.go | 2 +- features/stats/stats.go | 6 +- go.mod | 10 +- go.sum | 14 +- infra/conf/api.go | 10 +- infra/conf/blackhole.go | 4 +- infra/conf/blackhole_test.go | 6 +- infra/conf/common.go | 4 +- infra/conf/common_test.go | 8 +- infra/conf/conf.go | 2 +- infra/conf/dns.go | 6 +- infra/conf/dns_proxy.go | 4 +- infra/conf/dns_proxy_test.go | 6 +- infra/conf/dns_test.go | 14 +- infra/conf/dokodemo.go | 2 +- infra/conf/dokodemo_test.go | 6 +- infra/conf/errors.generated.go | 2 +- infra/conf/freedom.go | 6 +- infra/conf/freedom_test.go | 8 +- infra/conf/general_test.go | 4 +- infra/conf/http.go | 6 +- infra/conf/http_test.go | 4 +- infra/conf/json/reader.go | 2 +- infra/conf/json/reader_test.go | 4 +- infra/conf/log.go | 4 +- infra/conf/mtproto.go | 6 +- infra/conf/mtproto_test.go | 8 +- infra/conf/policy.go | 2 +- infra/conf/policy_test.go | 4 +- infra/conf/reverse.go | 2 +- infra/conf/reverse_test.go | 4 +- infra/conf/router.go | 6 +- infra/conf/router_test.go | 6 +- infra/conf/serial/errors.generated.go | 2 +- infra/conf/serial/loader.go | 8 +- infra/conf/serial/loader_test.go | 2 +- infra/conf/serial/serial.go | 2 +- infra/conf/shadowsocks.go | 6 +- infra/conf/shadowsocks_test.go | 10 +- infra/conf/socks.go | 6 +- infra/conf/socks_test.go | 10 +- infra/conf/transport.go | 6 +- infra/conf/transport_authenticators.go | 14 +- infra/conf/transport_internet.go | 24 +-- infra/conf/transport_test.go | 24 +-- infra/conf/trojan.go | 8 +- infra/conf/vless.go | 18 +- infra/conf/vless_test.go | 14 +- infra/conf/vmess.go | 10 +- infra/conf/vmess_test.go | 14 +- infra/conf/xray.go | 12 +- infra/conf/xray_test.go | 40 ++--- infra/vprotogen/main.go | 4 +- main/commands/all/api.go | 164 ------------------ main/commands/all/api/api.go | 23 +++ main/commands/all/api/inbounds_add.go | 73 ++++++++ main/commands/all/api/inbounds_remove.go | 74 ++++++++ main/commands/all/api/logger_restart.go | 37 ++++ main/commands/all/api/outbounds_add.go | 73 ++++++++ main/commands/all/api/outbounds_remove.go | 73 ++++++++ main/commands/all/api/shared.go | 119 +++++++++++++ main/commands/all/api/stats_get.go | 48 +++++ main/commands/all/api/stats_query.go | 48 +++++ main/commands/all/api/stats_sys.go | 37 ++++ main/commands/all/commands.go | 14 +- main/commands/all/convert.go | 10 +- main/commands/all/errors.generated.go | 2 +- main/commands/all/tls.go | 18 -- main/commands/all/{tlscmd => tls}/cert.go | 57 +++--- main/commands/all/{tlscmd => tls}/ping.go | 23 +-- main/commands/all/tls/tls.go | 17 ++ main/commands/all/uuid.go | 4 +- main/commands/base/command.go | 23 ++- main/commands/base/env.go | 3 + main/commands/base/execute.go | 2 +- main/commands/base/help.go | 40 +++-- main/confloader/errors.generated.go | 2 +- main/confloader/external/errors.generated.go | 2 +- main/confloader/external/external.go | 8 +- main/distro/all/all.go | 92 +++++----- main/errors.generated.go | 2 +- main/json/config_json.go | 10 +- main/json/errors.generated.go | 2 +- main/jsonem/errors.generated.go | 2 +- main/jsonem/jsonem.go | 20 ++- main/main.go | 4 +- main/run.go | 8 +- main/version.go | 4 +- proxy/blackhole/blackhole.go | 8 +- proxy/blackhole/blackhole_test.go | 12 +- proxy/blackhole/config.go | 4 +- proxy/blackhole/config.pb.go | 14 +- proxy/blackhole/config.proto | 2 +- proxy/blackhole/config_test.go | 6 +- proxy/blackhole/errors.generated.go | 2 +- proxy/dns/config.pb.go | 12 +- proxy/dns/config.proto | 2 +- proxy/dns/dns.go | 20 +-- proxy/dns/dns_test.go | 28 +-- proxy/dns/errors.generated.go | 2 +- proxy/dokodemo/config.go | 2 +- proxy/dokodemo/config.pb.go | 14 +- proxy/dokodemo/config.proto | 2 +- proxy/dokodemo/dokodemo.go | 26 +-- proxy/dokodemo/errors.generated.go | 2 +- proxy/freedom/config.pb.go | 14 +- proxy/freedom/config.proto | 2 +- proxy/freedom/errors.generated.go | 2 +- proxy/freedom/freedom.go | 28 +-- proxy/http/client.go | 28 +-- proxy/http/config.go | 2 +- proxy/http/config.pb.go | 12 +- proxy/http/config.proto | 2 +- proxy/http/errors.generated.go | 2 +- proxy/http/http.go | 2 +- proxy/http/server.go | 28 +-- proxy/mtproto/auth.go | 2 +- proxy/mtproto/auth_test.go | 4 +- proxy/mtproto/client.go | 16 +- proxy/mtproto/config.go | 2 +- proxy/mtproto/config.pb.go | 14 +- proxy/mtproto/config.proto | 2 +- proxy/mtproto/errors.generated.go | 2 +- proxy/mtproto/mtproto.go | 2 +- proxy/mtproto/server.go | 24 +-- proxy/proxy.go | 10 +- proxy/shadowsocks/client.go | 24 +-- proxy/shadowsocks/config.go | 8 +- proxy/shadowsocks/config.pb.go | 16 +- proxy/shadowsocks/config.proto | 2 +- proxy/shadowsocks/config_test.go | 6 +- proxy/shadowsocks/errors.generated.go | 2 +- proxy/shadowsocks/protocol.go | 10 +- proxy/shadowsocks/protocol_test.go | 10 +- proxy/shadowsocks/server.go | 28 +-- proxy/shadowsocks/shadowsocks.go | 2 +- proxy/socks/client.go | 24 +-- proxy/socks/config.go | 2 +- proxy/socks/config.pb.go | 16 +- proxy/socks/config.proto | 2 +- proxy/socks/errors.generated.go | 2 +- proxy/socks/protocol.go | 8 +- proxy/socks/protocol_test.go | 10 +- proxy/socks/server.go | 30 ++-- proxy/socks/socks.go | 2 +- proxy/trojan/client.go | 30 ++-- proxy/trojan/config.go | 4 +- proxy/trojan/config.pb.go | 14 +- proxy/trojan/config.proto | 2 +- proxy/trojan/errors.generated.go | 2 +- proxy/trojan/protocol.go | 14 +- proxy/trojan/protocol_test.go | 10 +- proxy/trojan/server.go | 38 ++-- proxy/trojan/validator.go | 2 +- proxy/vless/account.go | 4 +- proxy/vless/account.pb.go | 10 +- proxy/vless/account.proto | 2 +- proxy/vless/encoding/addons.go | 6 +- proxy/vless/encoding/addons.pb.go | 15 +- proxy/vless/encoding/addons.proto | 2 +- proxy/vless/encoding/encoding.go | 51 ++++-- proxy/vless/encoding/encoding_test.go | 14 +- proxy/vless/encoding/errors.generated.go | 2 +- proxy/vless/errors.generated.go | 2 +- proxy/vless/inbound/config.pb.go | 15 +- proxy/vless/inbound/config.proto | 2 +- proxy/vless/inbound/errors.generated.go | 2 +- proxy/vless/inbound/inbound.go | 48 ++--- proxy/vless/outbound/config.pb.go | 15 +- proxy/vless/outbound/config.proto | 2 +- proxy/vless/outbound/errors.generated.go | 2 +- proxy/vless/outbound/outbound.go | 47 ++--- proxy/vless/validator.go | 4 +- proxy/vless/vless.go | 3 +- proxy/vmess/account.go | 6 +- proxy/vmess/account.pb.go | 12 +- proxy/vmess/account.proto | 2 +- proxy/vmess/aead/authid.go | 4 +- proxy/vmess/aead/encrypt.go | 2 +- proxy/vmess/encoding/auth.go | 2 +- proxy/vmess/encoding/auth_test.go | 4 +- proxy/vmess/encoding/client.go | 18 +- proxy/vmess/encoding/commands.go | 12 +- proxy/vmess/encoding/commands_test.go | 10 +- proxy/vmess/encoding/encoding.go | 6 +- proxy/vmess/encoding/encoding_test.go | 14 +- proxy/vmess/encoding/errors.generated.go | 2 +- proxy/vmess/encoding/server.go | 20 +-- proxy/vmess/errors.generated.go | 2 +- proxy/vmess/inbound/config.pb.go | 16 +- proxy/vmess/inbound/config.proto | 2 +- proxy/vmess/inbound/errors.generated.go | 2 +- proxy/vmess/inbound/inbound.go | 36 ++-- proxy/vmess/outbound/command.go | 8 +- proxy/vmess/outbound/config.pb.go | 16 +- proxy/vmess/outbound/config.proto | 2 +- proxy/vmess/outbound/errors.generated.go | 2 +- proxy/vmess/outbound/outbound.go | 32 ++-- proxy/vmess/validator.go | 12 +- proxy/vmess/validator_test.go | 10 +- proxy/vmess/vmess.go | 2 +- testing/mocks/dns.go | 2 +- testing/mocks/log.go | 4 +- testing/mocks/mux.go | 4 +- testing/mocks/outbound.go | 4 +- testing/mocks/proxy.go | 10 +- testing/scenarios/command_test.go | 38 ++-- testing/scenarios/common.go | 18 +- testing/scenarios/common_coverage.go | 4 +- testing/scenarios/dns_test.go | 22 +-- testing/scenarios/dokodemo_test.go | 32 ++-- testing/scenarios/feature_test.go | 48 ++--- testing/scenarios/http_test.go | 20 +-- testing/scenarios/policy_test.go | 32 ++-- testing/scenarios/reverse_test.go | 38 ++-- testing/scenarios/shadowsocks_test.go | 28 +-- testing/scenarios/socks_test.go | 26 +-- testing/scenarios/tls_test.go | 38 ++-- testing/scenarios/transport_test.go | 42 ++--- testing/scenarios/vmess_test.go | 36 ++-- testing/servers/http/http.go | 2 +- testing/servers/tcp/port.go | 4 +- testing/servers/tcp/tcp.go | 10 +- testing/servers/udp/port.go | 4 +- testing/servers/udp/udp.go | 2 +- transport/config.go | 2 +- transport/config.pb.go | 12 +- transport/config.proto | 2 +- transport/internet/config.go | 4 +- transport/internet/config.pb.go | 14 +- transport/internet/config.proto | 2 +- transport/internet/connection.go | 2 +- transport/internet/dialer.go | 4 +- transport/internet/dialer_test.go | 8 +- transport/internet/domainsocket/config.go | 6 +- transport/internet/domainsocket/config.pb.go | 16 +- transport/internet/domainsocket/config.proto | 2 +- transport/internet/domainsocket/dial.go | 10 +- transport/internet/domainsocket/errgen.go | 2 +- .../internet/domainsocket/errors.generated.go | 2 +- transport/internet/domainsocket/listener.go | 10 +- .../internet/domainsocket/listener_test.go | 10 +- transport/internet/errors.generated.go | 2 +- transport/internet/header.go | 2 +- transport/internet/header_test.go | 14 +- transport/internet/headers/http/config.go | 2 +- transport/internet/headers/http/config.pb.go | 16 +- transport/internet/headers/http/config.proto | 2 +- .../internet/headers/http/errors.generated.go | 2 +- transport/internet/headers/http/http.go | 6 +- transport/internet/headers/http/http_test.go | 8 +- transport/internet/headers/noop/config.pb.go | 16 +- transport/internet/headers/noop/config.proto | 2 +- transport/internet/headers/noop/noop.go | 2 +- transport/internet/headers/srtp/config.pb.go | 16 +- transport/internet/headers/srtp/config.proto | 2 +- transport/internet/headers/srtp/srtp.go | 4 +- transport/internet/headers/srtp/srtp_test.go | 6 +- transport/internet/headers/tls/config.pb.go | 16 +- transport/internet/headers/tls/config.proto | 2 +- transport/internet/headers/tls/dtls.go | 4 +- transport/internet/headers/tls/dtls_test.go | 6 +- transport/internet/headers/utp/config.pb.go | 14 +- transport/internet/headers/utp/config.proto | 2 +- transport/internet/headers/utp/utp.go | 4 +- transport/internet/headers/utp/utp_test.go | 6 +- .../internet/headers/wechat/config.pb.go | 16 +- .../internet/headers/wechat/config.proto | 2 +- transport/internet/headers/wechat/wechat.go | 4 +- .../internet/headers/wechat/wechat_test.go | 6 +- .../internet/headers/wireguard/config.pb.go | 16 +- .../internet/headers/wireguard/config.proto | 2 +- .../internet/headers/wireguard/wireguard.go | 2 +- transport/internet/http/config.go | 6 +- transport/internet/http/config.pb.go | 14 +- transport/internet/http/config.proto | 2 +- transport/internet/http/dialer.go | 12 +- transport/internet/http/errors.generated.go | 2 +- transport/internet/http/http.go | 2 +- transport/internet/http/http_test.go | 16 +- transport/internet/http/hub.go | 16 +- transport/internet/internet.go | 2 +- transport/internet/kcp/config.go | 4 +- transport/internet/kcp/config.pb.go | 15 +- transport/internet/kcp/config.proto | 2 +- transport/internet/kcp/connection.go | 6 +- transport/internet/kcp/connection_test.go | 4 +- transport/internet/kcp/crypt.go | 2 +- transport/internet/kcp/crypt_test.go | 4 +- transport/internet/kcp/cryptreal.go | 2 +- transport/internet/kcp/dialer.go | 14 +- transport/internet/kcp/errors.generated.go | 2 +- transport/internet/kcp/io.go | 6 +- transport/internet/kcp/io_test.go | 2 +- transport/internet/kcp/kcp.go | 2 +- transport/internet/kcp/kcp_test.go | 10 +- transport/internet/kcp/listener.go | 14 +- transport/internet/kcp/output.go | 4 +- transport/internet/kcp/receiving.go | 2 +- transport/internet/kcp/segment.go | 2 +- transport/internet/kcp/segment_test.go | 2 +- transport/internet/kcp/sending.go | 2 +- transport/internet/quic/config.go | 6 +- transport/internet/quic/config.pb.go | 17 +- transport/internet/quic/config.proto | 2 +- transport/internet/quic/conn.go | 8 +- transport/internet/quic/dialer.go | 10 +- transport/internet/quic/errors.generated.go | 2 +- transport/internet/quic/hub.go | 12 +- transport/internet/quic/pool.go | 2 +- transport/internet/quic/quic.go | 6 +- transport/internet/quic/quic_test.go | 22 +-- transport/internet/sockopt_linux_test.go | 8 +- transport/internet/sockopt_test.go | 8 +- transport/internet/system_dialer.go | 4 +- transport/internet/system_listener.go | 4 +- transport/internet/system_listener_test.go | 4 +- transport/internet/tcp/config.go | 4 +- transport/internet/tcp/config.pb.go | 16 +- transport/internet/tcp/config.proto | 2 +- transport/internet/tcp/dialer.go | 12 +- transport/internet/tcp/errors.generated.go | 2 +- transport/internet/tcp/hub.go | 12 +- transport/internet/tcp/sockopt_freebsd.go | 4 +- transport/internet/tcp/sockopt_linux.go | 4 +- transport/internet/tcp/sockopt_linux_test.go | 8 +- transport/internet/tcp/sockopt_other.go | 4 +- transport/internet/tcp/tcp.go | 2 +- transport/internet/tcp_hub.go | 2 +- transport/internet/tls/config.go | 6 +- transport/internet/tls/config.pb.go | 14 +- transport/internet/tls/config.proto | 2 +- transport/internet/tls/config_test.go | 6 +- transport/internet/tls/errors.generated.go | 2 +- transport/internet/tls/tls.go | 6 +- transport/internet/udp/config.go | 4 +- transport/internet/udp/config.pb.go | 14 +- transport/internet/udp/config.proto | 2 +- transport/internet/udp/dialer.go | 6 +- transport/internet/udp/dispatcher.go | 18 +- transport/internet/udp/dispatcher_test.go | 16 +- transport/internet/udp/errors.generated.go | 2 +- transport/internet/udp/hub.go | 8 +- transport/internet/udp/hub_freebsd.go | 4 +- transport/internet/udp/hub_linux.go | 2 +- transport/internet/udp/hub_other.go | 2 +- transport/internet/udp/udp.go | 2 +- transport/internet/websocket/config.go | 4 +- transport/internet/websocket/config.pb.go | 14 +- transport/internet/websocket/config.proto | 2 +- transport/internet/websocket/connection.go | 6 +- transport/internet/websocket/dialer.go | 10 +- .../internet/websocket/errors.generated.go | 2 +- transport/internet/websocket/hub.go | 12 +- transport/internet/websocket/ws.go | 2 +- transport/internet/websocket/ws_test.go | 12 +- transport/internet/xtls/config.go | 6 +- transport/internet/xtls/config.pb.go | 13 +- transport/internet/xtls/config.proto | 2 +- transport/internet/xtls/config_test.go | 6 +- transport/internet/xtls/errors.generated.go | 2 +- transport/internet/xtls/xtls.go | 4 +- transport/link.go | 2 +- transport/pipe/impl.go | 8 +- transport/pipe/pipe.go | 6 +- transport/pipe/pipe_test.go | 6 +- transport/pipe/reader.go | 2 +- transport/pipe/writer.go | 2 +- 627 files changed, 3247 insertions(+), 2635 deletions(-) delete mode 100644 main/commands/all/api.go create mode 100644 main/commands/all/api/api.go create mode 100644 main/commands/all/api/inbounds_add.go create mode 100644 main/commands/all/api/inbounds_remove.go create mode 100644 main/commands/all/api/logger_restart.go create mode 100644 main/commands/all/api/outbounds_add.go create mode 100644 main/commands/all/api/outbounds_remove.go create mode 100644 main/commands/all/api/shared.go create mode 100644 main/commands/all/api/stats_get.go create mode 100644 main/commands/all/api/stats_query.go create mode 100644 main/commands/all/api/stats_sys.go delete mode 100644 main/commands/all/tls.go rename main/commands/all/{tlscmd => tls}/cert.go (67%) rename main/commands/all/{tlscmd => tls}/ping.go (86%) create mode 100644 main/commands/all/tls/tls.go diff --git a/app/commander/commander.go b/app/commander/commander.go index 1a2dfd304..dc7a9b9a1 100644 --- a/app/commander/commander.go +++ b/app/commander/commander.go @@ -2,7 +2,7 @@ package commander -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" @@ -11,10 +11,10 @@ import ( "google.golang.org/grpc" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/signal/done" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/outbound" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/signal/done" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/outbound" ) // Commander is a Xray feature that provides gRPC methods to external clients. diff --git a/app/commander/config.pb.go b/app/commander/config.pb.go index 15940aee1..c10693ec8 100644 --- a/app/commander/config.pb.go +++ b/app/commander/config.pb.go @@ -8,7 +8,7 @@ package commander import ( proto "github.com/golang/protobuf/proto" - serial "github.com/xtls/xray-core/v1/common/serial" + serial "github.com/xtls/xray-core/common/serial" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -139,13 +139,13 @@ var file_app_commander_config_proto_rawDesc = []byte{ 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, - 0x5b, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, + 0x58, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, - 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, - 0x70, 0x70, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x65, 0x72, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/app/commander/config.proto b/app/commander/config.proto index d80261ab1..91d7b0615 100644 --- a/app/commander/config.proto +++ b/app/commander/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.commander; option csharp_namespace = "Xray.App.Commander"; -option go_package = "github.com/xtls/xray-core/v1/app/commander"; +option go_package = "github.com/xtls/xray-core/app/commander"; option java_package = "com.xray.app.commander"; option java_multiple_files = true; diff --git a/app/commander/errors.generated.go b/app/commander/errors.generated.go index 058fb9cd7..c3cac3293 100644 --- a/app/commander/errors.generated.go +++ b/app/commander/errors.generated.go @@ -1,6 +1,6 @@ package commander -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/commander/outbound.go b/app/commander/outbound.go index 616a61f83..dac5982d6 100644 --- a/app/commander/outbound.go +++ b/app/commander/outbound.go @@ -6,10 +6,10 @@ import ( "context" "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/transport" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/transport" ) // OutboundListener is a net.Listener for listening gRPC connections. diff --git a/app/commander/service.go b/app/commander/service.go index 8039ade90..5b1e1acbd 100644 --- a/app/commander/service.go +++ b/app/commander/service.go @@ -5,7 +5,7 @@ package commander import ( "context" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" "google.golang.org/grpc" "google.golang.org/grpc/reflection" ) diff --git a/app/dispatcher/config.pb.go b/app/dispatcher/config.pb.go index 1d994307d..bb39e36ec 100644 --- a/app/dispatcher/config.pb.go +++ b/app/dispatcher/config.pb.go @@ -122,13 +122,13 @@ var file_app_dispatcher_config_proto_rawDesc = []byte{ 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x42, 0x5e, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, + 0x6e, 0x67, 0x73, 0x42, 0x5b, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x50, 0x01, - 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, - 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, - 0x70, 0x70, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0xaa, 0x02, 0x13, - 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, - 0x68, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, + 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, + 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0xaa, 0x02, 0x13, 0x58, 0x72, 0x61, + 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/dispatcher/config.proto b/app/dispatcher/config.proto index 7ffa96d6d..e67942388 100644 --- a/app/dispatcher/config.proto +++ b/app/dispatcher/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.dispatcher; option csharp_namespace = "Xray.App.Dispatcher"; -option go_package = "github.com/xtls/xray-core/v1/app/dispatcher"; +option go_package = "github.com/xtls/xray-core/app/dispatcher"; option java_package = "com.xray.app.dispatcher"; option java_multiple_files = true; diff --git a/app/dispatcher/default.go b/app/dispatcher/default.go index 6ec313e7d..27fb9831b 100644 --- a/app/dispatcher/default.go +++ b/app/dispatcher/default.go @@ -2,7 +2,7 @@ package dispatcher -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" @@ -10,20 +10,20 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - routing_session "github.com/xtls/xray-core/v1/features/routing/session" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + routing_session "github.com/xtls/xray-core/features/routing/session" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/pipe" ) var ( diff --git a/app/dispatcher/dispatcher.go b/app/dispatcher/dispatcher.go index e8b24b513..521cebbc2 100644 --- a/app/dispatcher/dispatcher.go +++ b/app/dispatcher/dispatcher.go @@ -2,4 +2,4 @@ package dispatcher -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/app/dispatcher/errors.generated.go b/app/dispatcher/errors.generated.go index 79f6094ae..e13ee6088 100644 --- a/app/dispatcher/errors.generated.go +++ b/app/dispatcher/errors.generated.go @@ -1,6 +1,6 @@ package dispatcher -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/dispatcher/sniffer.go b/app/dispatcher/sniffer.go index e7bdda6df..d14481d9d 100644 --- a/app/dispatcher/sniffer.go +++ b/app/dispatcher/sniffer.go @@ -3,10 +3,10 @@ package dispatcher import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/protocol/bittorrent" - "github.com/xtls/xray-core/v1/common/protocol/http" - "github.com/xtls/xray-core/v1/common/protocol/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/protocol/bittorrent" + "github.com/xtls/xray-core/common/protocol/http" + "github.com/xtls/xray-core/common/protocol/tls" ) type SniffResult interface { diff --git a/app/dispatcher/stats.go b/app/dispatcher/stats.go index 02bd00eea..6f7bad9da 100644 --- a/app/dispatcher/stats.go +++ b/app/dispatcher/stats.go @@ -3,9 +3,9 @@ package dispatcher import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/features/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/features/stats" ) type SizeStatWriter struct { diff --git a/app/dispatcher/stats_test.go b/app/dispatcher/stats_test.go index e4f2f2ed0..6eca32a4a 100644 --- a/app/dispatcher/stats_test.go +++ b/app/dispatcher/stats_test.go @@ -3,9 +3,9 @@ package dispatcher_test import ( "testing" - . "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" + . "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" ) type TestCounter int64 diff --git a/app/dns/config.pb.go b/app/dns/config.pb.go index fda7d91f3..5a3368af2 100644 --- a/app/dns/config.pb.go +++ b/app/dns/config.pb.go @@ -8,8 +8,8 @@ package dns import ( proto "github.com/golang/protobuf/proto" - router "github.com/xtls/xray-core/v1/app/router" - net "github.com/xtls/xray-core/v1/common/net" + router "github.com/xtls/xray-core/app/router" + net "github.com/xtls/xray-core/common/net" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -511,13 +511,12 @@ var file_app_dns_config_proto_rawDesc = []byte{ 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x75, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, - 0x64, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x65, 0x67, 0x65, 0x78, 0x10, 0x03, 0x42, 0x49, + 0x64, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x65, 0x67, 0x65, 0x78, 0x10, 0x03, 0x42, 0x46, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, - 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x0c, 0x58, 0x72, 0x61, - 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x44, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x61, 0x70, 0x70, 0x2f, 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x0c, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, + 0x70, 0x70, 0x2e, 0x44, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/dns/config.proto b/app/dns/config.proto index 7da491bc9..3ab825001 100644 --- a/app/dns/config.proto +++ b/app/dns/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.dns; option csharp_namespace = "Xray.App.Dns"; -option go_package = "github.com/xtls/xray-core/v1/app/dns"; +option go_package = "github.com/xtls/xray-core/app/dns"; option java_package = "com.xray.app.dns"; option java_multiple_files = true; diff --git a/app/dns/dns.go b/app/dns/dns.go index b64307abd..e56671e4d 100644 --- a/app/dns/dns.go +++ b/app/dns/dns.go @@ -1,4 +1,4 @@ // Package dns is an implementation of core.DNS feature. package dns -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/app/dns/dnscommon.go b/app/dns/dnscommon.go index c2f1f0759..888c6c04f 100644 --- a/app/dns/dnscommon.go +++ b/app/dns/dnscommon.go @@ -6,10 +6,10 @@ import ( "encoding/binary" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - dns_feature "github.com/xtls/xray-core/v1/features/dns" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + dns_feature "github.com/xtls/xray-core/features/dns" "golang.org/x/net/dns/dnsmessage" ) diff --git a/app/dns/dnscommon_test.go b/app/dns/dnscommon_test.go index cd7151800..51d37a639 100644 --- a/app/dns/dnscommon_test.go +++ b/app/dns/dnscommon_test.go @@ -9,8 +9,8 @@ import ( "github.com/google/go-cmp/cmp" "github.com/miekg/dns" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" "golang.org/x/net/dns/dnsmessage" ) diff --git a/app/dns/dohdns.go b/app/dns/dohdns.go index ddfebb3bd..1a1e8b940 100644 --- a/app/dns/dohdns.go +++ b/app/dns/dohdns.go @@ -14,15 +14,15 @@ import ( "sync/atomic" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/dns" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal/pubsub" - "github.com/xtls/xray-core/v1/common/task" - dns_feature "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/dns" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal/pubsub" + "github.com/xtls/xray-core/common/task" + dns_feature "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet" "golang.org/x/net/dns/dnsmessage" ) diff --git a/app/dns/errors.generated.go b/app/dns/errors.generated.go index ce4c0605e..d7375a9b9 100644 --- a/app/dns/errors.generated.go +++ b/app/dns/errors.generated.go @@ -1,6 +1,6 @@ package dns -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/dns/hosts.go b/app/dns/hosts.go index cd8048f6f..7275f2d66 100644 --- a/app/dns/hosts.go +++ b/app/dns/hosts.go @@ -3,10 +3,10 @@ package dns import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/strmatcher" - "github.com/xtls/xray-core/v1/features" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/strmatcher" + "github.com/xtls/xray-core/features" ) // StaticHosts represents static domain-ip mapping in DNS server. diff --git a/app/dns/hosts_test.go b/app/dns/hosts_test.go index 401abdfda..c2f996940 100644 --- a/app/dns/hosts_test.go +++ b/app/dns/hosts_test.go @@ -5,9 +5,9 @@ import ( "github.com/google/go-cmp/cmp" - . "github.com/xtls/xray-core/v1/app/dns" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" + . "github.com/xtls/xray-core/app/dns" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" ) func TestStaticHosts(t *testing.T) { diff --git a/app/dns/nameserver.go b/app/dns/nameserver.go index 02cf8f596..14d3a2175 100644 --- a/app/dns/nameserver.go +++ b/app/dns/nameserver.go @@ -5,8 +5,8 @@ package dns import ( "context" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features/dns/localdns" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features/dns/localdns" ) // IPOption is an object for IP query options. diff --git a/app/dns/nameserver_test.go b/app/dns/nameserver_test.go index 9aa90ae44..53638d2da 100644 --- a/app/dns/nameserver_test.go +++ b/app/dns/nameserver_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - . "github.com/xtls/xray-core/v1/app/dns" - "github.com/xtls/xray-core/v1/common" + . "github.com/xtls/xray-core/app/dns" + "github.com/xtls/xray-core/common" ) func TestLocalNameServer(t *testing.T) { diff --git a/app/dns/server.go b/app/dns/server.go index 40ff21a30..6c42911c2 100644 --- a/app/dns/server.go +++ b/app/dns/server.go @@ -2,7 +2,7 @@ package dns -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" @@ -13,17 +13,17 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/strmatcher" - "github.com/xtls/xray-core/v1/common/uuid" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features" - "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/routing" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/strmatcher" + "github.com/xtls/xray-core/common/uuid" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features" + "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/routing" ) // Server is a DNS rely server. diff --git a/app/dns/server_test.go b/app/dns/server_test.go index d57a894e1..2e517609a 100644 --- a/app/dns/server_test.go +++ b/app/dns/server_test.go @@ -7,19 +7,19 @@ import ( "github.com/google/go-cmp/cmp" "github.com/miekg/dns" - "github.com/xtls/xray-core/v1/app/dispatcher" - . "github.com/xtls/xray-core/v1/app/dns" - "github.com/xtls/xray-core/v1/app/policy" - "github.com/xtls/xray-core/v1/app/proxyman" - _ "github.com/xtls/xray-core/v1/app/proxyman/outbound" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/core" - feature_dns "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/testing/servers/udp" + "github.com/xtls/xray-core/app/dispatcher" + . "github.com/xtls/xray-core/app/dns" + "github.com/xtls/xray-core/app/policy" + "github.com/xtls/xray-core/app/proxyman" + _ "github.com/xtls/xray-core/app/proxyman/outbound" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/core" + feature_dns "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/testing/servers/udp" ) type staticHandler struct { diff --git a/app/dns/udpns.go b/app/dns/udpns.go index ffcd8c040..a285a53b5 100644 --- a/app/dns/udpns.go +++ b/app/dns/udpns.go @@ -9,16 +9,16 @@ import ( "sync/atomic" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/dns" - udp_proto "github.com/xtls/xray-core/v1/common/protocol/udp" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal/pubsub" - "github.com/xtls/xray-core/v1/common/task" - dns_feature "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet/udp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/dns" + udp_proto "github.com/xtls/xray-core/common/protocol/udp" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal/pubsub" + "github.com/xtls/xray-core/common/task" + dns_feature "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet/udp" "golang.org/x/net/dns/dnsmessage" ) diff --git a/app/log/command/command.go b/app/log/command/command.go index 56eb22e4a..2c565b008 100644 --- a/app/log/command/command.go +++ b/app/log/command/command.go @@ -2,16 +2,16 @@ package command -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" grpc "google.golang.org/grpc" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/core" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/core" ) type LoggerServer struct { diff --git a/app/log/command/command_test.go b/app/log/command/command_test.go index 6ca17ee06..bd3970a54 100644 --- a/app/log/command/command_test.go +++ b/app/log/command/command_test.go @@ -4,15 +4,15 @@ import ( "context" "testing" - "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/app/log" - . "github.com/xtls/xray-core/v1/app/log/command" - "github.com/xtls/xray-core/v1/app/proxyman" - _ "github.com/xtls/xray-core/v1/app/proxyman/inbound" - _ "github.com/xtls/xray-core/v1/app/proxyman/outbound" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/core" + "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/app/log" + . "github.com/xtls/xray-core/app/log/command" + "github.com/xtls/xray-core/app/proxyman" + _ "github.com/xtls/xray-core/app/proxyman/inbound" + _ "github.com/xtls/xray-core/app/proxyman/outbound" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/core" ) func TestLoggerRestart(t *testing.T) { diff --git a/app/log/command/config.pb.go b/app/log/command/config.pb.go index d782874e2..db046b40f 100644 --- a/app/log/command/config.pb.go +++ b/app/log/command/config.pb.go @@ -156,14 +156,14 @@ var file_app_log_command_config_proto_rawDesc = []byte{ 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x67, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x61, 0x0a, 0x18, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, - 0x41, 0x70, 0x70, 0x2e, 0x4c, 0x6f, 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, + 0x2e, 0x4c, 0x6f, 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/log/command/config.proto b/app/log/command/config.proto index 1a24080f1..2ebf40aaa 100644 --- a/app/log/command/config.proto +++ b/app/log/command/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.log.command; option csharp_namespace = "Xray.App.Log.Command"; -option go_package = "github.com/xtls/xray-core/v1/app/log/command"; +option go_package = "github.com/xtls/xray-core/app/log/command"; option java_package = "com.xray.app.log.command"; option java_multiple_files = true; diff --git a/app/log/command/config_grpc.pb.go b/app/log/command/config_grpc.pb.go index 464e950e7..584394384 100644 --- a/app/log/command/config_grpc.pb.go +++ b/app/log/command/config_grpc.pb.go @@ -63,6 +63,7 @@ type UnsafeLoggerServiceServer interface { func RegisterLoggerServiceServer(s grpc.ServiceRegistrar, srv LoggerServiceServer) { s.RegisterService(&_LoggerService_serviceDesc, srv) + s.RegisterService(&_LoggerService_serviceDesc2, srv) } func _LoggerService_RestartLogger_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -95,3 +96,16 @@ var _LoggerService_serviceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "app/log/command/config.proto", } + +var _LoggerService_serviceDesc2 = grpc.ServiceDesc{ + ServiceName: "v2ray.core.app.log.command.LoggerService", + HandlerType: (*LoggerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RestartLogger", + Handler: _LoggerService_RestartLogger_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "app/log/command/config.proto", +} diff --git a/app/log/command/errors.generated.go b/app/log/command/errors.generated.go index 76b46f511..a13059329 100644 --- a/app/log/command/errors.generated.go +++ b/app/log/command/errors.generated.go @@ -1,6 +1,6 @@ package command -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/log/config.pb.go b/app/log/config.pb.go index 1253288ba..85463847b 100644 --- a/app/log/config.pb.go +++ b/app/log/config.pb.go @@ -8,7 +8,7 @@ package log import ( proto "github.com/golang/protobuf/proto" - log "github.com/xtls/xray-core/v1/common/log" + log "github.com/xtls/xray-core/common/log" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -184,12 +184,12 @@ var file_app_log_config_proto_rawDesc = []byte{ 0x74, 0x68, 0x2a, 0x35, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x10, 0x02, 0x12, 0x09, - 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x10, 0x03, 0x42, 0x49, 0x0a, 0x10, 0x63, 0x6f, 0x6d, + 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x10, 0x03, 0x42, 0x46, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x50, 0x01, 0x5a, - 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, - 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, - 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0xaa, 0x02, 0x0c, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, - 0x2e, 0x4c, 0x6f, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, + 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6c, + 0x6f, 0x67, 0xaa, 0x02, 0x0c, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x4c, 0x6f, + 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/log/config.proto b/app/log/config.proto index 32ac2b88c..401e727c6 100644 --- a/app/log/config.proto +++ b/app/log/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.log; option csharp_namespace = "Xray.App.Log"; -option go_package = "github.com/xtls/xray-core/v1/app/log"; +option go_package = "github.com/xtls/xray-core/app/log"; option java_package = "com.xray.app.log"; option java_multiple_files = true; diff --git a/app/log/errors.generated.go b/app/log/errors.generated.go index 6163bc84c..e09634a97 100644 --- a/app/log/errors.generated.go +++ b/app/log/errors.generated.go @@ -1,6 +1,6 @@ package log -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/log/log.go b/app/log/log.go index 2260db4d5..629a2420a 100644 --- a/app/log/log.go +++ b/app/log/log.go @@ -2,14 +2,14 @@ package log -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/log" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/log" ) // Instance is a log.Handler that handles logs. diff --git a/app/log/log_creator.go b/app/log/log_creator.go index e62ffdcc0..dca8b95f0 100644 --- a/app/log/log_creator.go +++ b/app/log/log_creator.go @@ -3,8 +3,8 @@ package log import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/log" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/log" ) type HandlerCreatorOptions struct { diff --git a/app/log/log_test.go b/app/log/log_test.go index a3e6df2ae..cda55f628 100644 --- a/app/log/log_test.go +++ b/app/log/log_test.go @@ -5,10 +5,10 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/testing/mocks" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/testing/mocks" ) func TestCustomLogHandler(t *testing.T) { diff --git a/app/policy/config.go b/app/policy/config.go index 8ead6bd89..267307b79 100644 --- a/app/policy/config.go +++ b/app/policy/config.go @@ -3,7 +3,7 @@ package policy import ( "time" - "github.com/xtls/xray-core/v1/features/policy" + "github.com/xtls/xray-core/features/policy" ) // Duration converts Second to time.Duration. diff --git a/app/policy/config.pb.go b/app/policy/config.pb.go index 53986ec02..37597afd4 100644 --- a/app/policy/config.pb.go +++ b/app/policy/config.pb.go @@ -554,12 +554,12 @@ var file_app_policy_config_proto_rawDesc = []byte{ 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x42, 0x52, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, + 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0xaa, + 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/policy/config.proto b/app/policy/config.proto index 14d5fa57c..e5f295472 100644 --- a/app/policy/config.proto +++ b/app/policy/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.policy; option csharp_namespace = "Xray.App.Policy"; -option go_package = "github.com/xtls/xray-core/v1/app/policy"; +option go_package = "github.com/xtls/xray-core/app/policy"; option java_package = "com.xray.app.policy"; option java_multiple_files = true; diff --git a/app/policy/errors.generated.go b/app/policy/errors.generated.go index 506b4e7e7..1fe4d613a 100644 --- a/app/policy/errors.generated.go +++ b/app/policy/errors.generated.go @@ -1,6 +1,6 @@ package policy -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/policy/manager.go b/app/policy/manager.go index c99bb32ee..ad2c6255c 100644 --- a/app/policy/manager.go +++ b/app/policy/manager.go @@ -3,8 +3,8 @@ package policy import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features/policy" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features/policy" ) // Instance is an instance of Policy manager. diff --git a/app/policy/manager_test.go b/app/policy/manager_test.go index 561672287..e738a380b 100644 --- a/app/policy/manager_test.go +++ b/app/policy/manager_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" - . "github.com/xtls/xray-core/v1/app/policy" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features/policy" + . "github.com/xtls/xray-core/app/policy" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features/policy" ) func TestPolicy(t *testing.T) { diff --git a/app/policy/policy.go b/app/policy/policy.go index d91e43331..cbb1d90e3 100644 --- a/app/policy/policy.go +++ b/app/policy/policy.go @@ -1,4 +1,4 @@ // Package policy is an implementation of policy.Manager feature. package policy -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/app/proxyman/command/command.go b/app/proxyman/command/command.go index 09aa4c756..e04046079 100644 --- a/app/proxyman/command/command.go +++ b/app/proxyman/command/command.go @@ -7,11 +7,11 @@ import ( grpc "google.golang.org/grpc" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/inbound" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/proxy" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/inbound" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/proxy" ) // InboundOperation is the interface for operations that applies to inbound handlers. diff --git a/app/proxyman/command/command.pb.go b/app/proxyman/command/command.pb.go index 02b5f4b6a..74ad5cfda 100644 --- a/app/proxyman/command/command.pb.go +++ b/app/proxyman/command/command.pb.go @@ -8,9 +8,9 @@ package command import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" - serial "github.com/xtls/xray-core/v1/common/serial" - core "github.com/xtls/xray-core/v1/core" + protocol "github.com/xtls/xray-core/common/protocol" + serial "github.com/xtls/xray-core/common/serial" + core "github.com/xtls/xray-core/core" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -788,14 +788,14 @@ var file_app_proxyman_command_command_proto_rawDesc = []byte{ 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x42, 0x70, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, + 0x00, 0x42, 0x6d, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2f, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x19, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, - 0x70, 0x70, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x19, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/proxyman/command/command.proto b/app/proxyman/command/command.proto index 6be2b123f..5a09bd88d 100644 --- a/app/proxyman/command/command.proto +++ b/app/proxyman/command/command.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.proxyman.command; option csharp_namespace = "Xray.App.Proxyman.Command"; -option go_package = "github.com/xtls/xray-core/v1/app/proxyman/command"; +option go_package = "github.com/xtls/xray-core/app/proxyman/command"; option java_package = "com.xray.app.proxyman.command"; option java_multiple_files = true; diff --git a/app/proxyman/command/command_grpc.pb.go b/app/proxyman/command/command_grpc.pb.go index 41fb3e435..4069f25ea 100644 --- a/app/proxyman/command/command_grpc.pb.go +++ b/app/proxyman/command/command_grpc.pb.go @@ -133,6 +133,7 @@ type UnsafeHandlerServiceServer interface { func RegisterHandlerServiceServer(s grpc.ServiceRegistrar, srv HandlerServiceServer) { s.RegisterService(&_HandlerService_serviceDesc, srv) + s.RegisterService(&_HandlerService_serviceDesc2, srv) } func _HandlerService_AddInbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -275,3 +276,36 @@ var _HandlerService_serviceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "app/proxyman/command/command.proto", } + +var _HandlerService_serviceDesc2 = grpc.ServiceDesc{ + ServiceName: "v2ray.core.app.proxyman.command.HandlerService", + HandlerType: (*HandlerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AddInbound", + Handler: _HandlerService_AddInbound_Handler, + }, + { + MethodName: "RemoveInbound", + Handler: _HandlerService_RemoveInbound_Handler, + }, + { + MethodName: "AlterInbound", + Handler: _HandlerService_AlterInbound_Handler, + }, + { + MethodName: "AddOutbound", + Handler: _HandlerService_AddOutbound_Handler, + }, + { + MethodName: "RemoveOutbound", + Handler: _HandlerService_RemoveOutbound_Handler, + }, + { + MethodName: "AlterOutbound", + Handler: _HandlerService_AlterOutbound_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "app/proxyman/command/command.proto", +} diff --git a/app/proxyman/command/doc.go b/app/proxyman/command/doc.go index f6680e0db..2aa6d95f2 100644 --- a/app/proxyman/command/doc.go +++ b/app/proxyman/command/doc.go @@ -1,3 +1,3 @@ package command -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/app/proxyman/command/errors.generated.go b/app/proxyman/command/errors.generated.go index 76b46f511..a13059329 100644 --- a/app/proxyman/command/errors.generated.go +++ b/app/proxyman/command/errors.generated.go @@ -1,6 +1,6 @@ package command -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/proxyman/config.pb.go b/app/proxyman/config.pb.go index 7fa8a7677..a4a20fc34 100644 --- a/app/proxyman/config.pb.go +++ b/app/proxyman/config.pb.go @@ -8,9 +8,9 @@ package proxyman import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" - serial "github.com/xtls/xray-core/v1/common/serial" - internet "github.com/xtls/xray-core/v1/transport/internet" + net "github.com/xtls/xray-core/common/net" + serial "github.com/xtls/xray-core/common/serial" + internet "github.com/xtls/xray-core/transport/internet" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -835,13 +835,13 @@ var file_app_proxyman_config_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x2a, 0x23, 0x0a, 0x0e, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x10, 0x00, 0x12, 0x07, 0x0a, - 0x03, 0x54, 0x4c, 0x53, 0x10, 0x01, 0x42, 0x58, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, + 0x03, 0x54, 0x4c, 0x53, 0x10, 0x01, 0x42, 0x55, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x50, - 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, - 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0xaa, 0x02, 0x11, 0x58, - 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, + 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, + 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0xaa, 0x02, 0x11, 0x58, 0x72, 0x61, 0x79, + 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/proxyman/config.proto b/app/proxyman/config.proto index 3d84b5756..e32d45033 100644 --- a/app/proxyman/config.proto +++ b/app/proxyman/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.proxyman; option csharp_namespace = "Xray.App.Proxyman"; -option go_package = "github.com/xtls/xray-core/v1/app/proxyman"; +option go_package = "github.com/xtls/xray-core/app/proxyman"; option java_package = "com.xray.app.proxyman"; option java_multiple_files = true; diff --git a/app/proxyman/inbound/always.go b/app/proxyman/inbound/always.go index c2a996462..43174a0fc 100644 --- a/app/proxyman/inbound/always.go +++ b/app/proxyman/inbound/always.go @@ -3,17 +3,17 @@ package inbound import ( "context" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/proxy" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/proxy" + "github.com/xtls/xray-core/transport/internet" ) func getStatCounter(v *core.Instance, tag string) (stats.Counter, stats.Counter) { diff --git a/app/proxyman/inbound/dynamic.go b/app/proxyman/inbound/dynamic.go index 90772e503..f67509761 100644 --- a/app/proxyman/inbound/dynamic.go +++ b/app/proxyman/inbound/dynamic.go @@ -5,14 +5,14 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy" + "github.com/xtls/xray-core/transport/internet" ) type DynamicInboundHandler struct { diff --git a/app/proxyman/inbound/errors.generated.go b/app/proxyman/inbound/errors.generated.go index f1f4116fe..c2d7295e4 100644 --- a/app/proxyman/inbound/errors.generated.go +++ b/app/proxyman/inbound/errors.generated.go @@ -1,6 +1,6 @@ package inbound -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/proxyman/inbound/inbound.go b/app/proxyman/inbound/inbound.go index e734c7d40..0846b8568 100644 --- a/app/proxyman/inbound/inbound.go +++ b/app/proxyman/inbound/inbound.go @@ -1,17 +1,17 @@ package inbound -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "sync" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/inbound" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/inbound" ) // Manager is to manage all inbound handlers. diff --git a/app/proxyman/inbound/worker.go b/app/proxyman/inbound/worker.go index b59fde8e9..94df0dddf 100644 --- a/app/proxyman/inbound/worker.go +++ b/app/proxyman/inbound/worker.go @@ -6,21 +6,21 @@ import ( "sync/atomic" "time" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/proxy" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tcp" - "github.com/xtls/xray-core/v1/transport/internet/udp" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/proxy" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tcp" + "github.com/xtls/xray-core/transport/internet/udp" + "github.com/xtls/xray-core/transport/pipe" ) type worker interface { @@ -78,17 +78,7 @@ func (w *tcpWorker) callback(conn internet.Connection) { }) } } - ctx = session.ContextWithInbound(ctx, &session.Inbound{ - Source: net.DestinationFromAddr(conn.RemoteAddr()), - Gateway: net.TCPDestination(w.address, w.port), - Tag: w.tag, - }) - content := new(session.Content) - if w.sniffingConfig != nil { - content.SniffingRequest.Enabled = w.sniffingConfig.Enabled - content.SniffingRequest.OverrideDestinationForProtocol = w.sniffingConfig.DestinationOverride - } - ctx = session.ContextWithContent(ctx, content) + if w.uplinkCounter != nil || w.downlinkCounter != nil { conn = &internet.StatCouterConnection{ Connection: conn, @@ -96,6 +86,20 @@ func (w *tcpWorker) callback(conn internet.Connection) { WriteCounter: w.downlinkCounter, } } + ctx = session.ContextWithInbound(ctx, &session.Inbound{ + Source: net.DestinationFromAddr(conn.RemoteAddr()), + Gateway: net.TCPDestination(w.address, w.port), + Tag: w.tag, + Conn: conn, + }) + + content := new(session.Content) + if w.sniffingConfig != nil { + content.SniffingRequest.Enabled = w.sniffingConfig.Enabled + content.SniffingRequest.OverrideDestinationForProtocol = w.sniffingConfig.DestinationOverride + } + ctx = session.ContextWithContent(ctx, content) + if err := w.proxy.Process(ctx, net.Network_TCP, conn, w.dispatcher); err != nil { newError("connection ends").Base(err).WriteToLog(session.ExportIDToError(ctx)) } diff --git a/app/proxyman/outbound/errors.generated.go b/app/proxyman/outbound/errors.generated.go index b6bfdd868..079668236 100644 --- a/app/proxyman/outbound/errors.generated.go +++ b/app/proxyman/outbound/errors.generated.go @@ -1,6 +1,6 @@ package outbound -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/proxyman/outbound/handler.go b/app/proxyman/outbound/handler.go index d71c0179b..91945ea9d 100644 --- a/app/proxyman/outbound/handler.go +++ b/app/proxyman/outbound/handler.go @@ -3,20 +3,20 @@ package outbound import ( "context" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/proxy" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/proxy" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/pipe" ) func getStatCounter(v *core.Instance, tag string) (stats.Counter, stats.Counter) { diff --git a/app/proxyman/outbound/handler_test.go b/app/proxyman/outbound/handler_test.go index cdb3047e5..a557ddc0b 100644 --- a/app/proxyman/outbound/handler_test.go +++ b/app/proxyman/outbound/handler_test.go @@ -4,15 +4,15 @@ import ( "context" "testing" - "github.com/xtls/xray-core/v1/app/policy" - . "github.com/xtls/xray-core/v1/app/proxyman/outbound" - "github.com/xtls/xray-core/v1/app/stats" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/app/policy" + . "github.com/xtls/xray-core/app/proxyman/outbound" + "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/transport/internet" ) func TestInterfaces(t *testing.T) { diff --git a/app/proxyman/outbound/outbound.go b/app/proxyman/outbound/outbound.go index 5a526c436..40f98ba9f 100644 --- a/app/proxyman/outbound/outbound.go +++ b/app/proxyman/outbound/outbound.go @@ -1,17 +1,17 @@ package outbound -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "strings" "sync" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/outbound" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/outbound" ) // Manager is to manage all outbound handlers. diff --git a/app/reverse/bridge.go b/app/reverse/bridge.go index 2f49a8651..19160f4c7 100644 --- a/app/reverse/bridge.go +++ b/app/reverse/bridge.go @@ -7,13 +7,13 @@ import ( "time" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/pipe" ) // Bridge is a component in reverse proxy, that relays connections from Portal to local address. diff --git a/app/reverse/config.go b/app/reverse/config.go index 38b3bc835..ce70c71b9 100644 --- a/app/reverse/config.go +++ b/app/reverse/config.go @@ -6,7 +6,7 @@ import ( "crypto/rand" "io" - "github.com/xtls/xray-core/v1/common/dice" + "github.com/xtls/xray-core/common/dice" ) func (c *Control) FillInRandom() { diff --git a/app/reverse/config.pb.go b/app/reverse/config.pb.go index 810c113f4..50e41edd0 100644 --- a/app/reverse/config.pb.go +++ b/app/reverse/config.pb.go @@ -321,13 +321,12 @@ var file_app_reverse_config_proto_rawDesc = []byte{ 0x0b, 0x32, 0x1e, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0c, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, - 0x59, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, + 0x56, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x01, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, - 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x65, - 0x76, 0x65, 0x72, 0x73, 0x65, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x65, 0x76, 0x65, 0x72, + 0x73, 0x65, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, + 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/reverse/config.proto b/app/reverse/config.proto index da5b5aa34..35bf74be6 100644 --- a/app/reverse/config.proto +++ b/app/reverse/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.reverse; option csharp_namespace = "Xray.Proxy.Reverse"; -option go_package = "github.com/xtls/xray-core/v1/app/reverse"; +option go_package = "github.com/xtls/xray-core/app/reverse"; option java_package = "com.xray.proxy.reverse"; option java_multiple_files = true; diff --git a/app/reverse/errors.generated.go b/app/reverse/errors.generated.go index 821ec7b0b..5dc907a23 100644 --- a/app/reverse/errors.generated.go +++ b/app/reverse/errors.generated.go @@ -1,6 +1,6 @@ package reverse -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/reverse/portal.go b/app/reverse/portal.go index 9c4ee190f..460234e43 100644 --- a/app/reverse/portal.go +++ b/app/reverse/portal.go @@ -8,15 +8,15 @@ import ( "time" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/pipe" ) type Portal struct { diff --git a/app/reverse/portal_test.go b/app/reverse/portal_test.go index 7a951f4aa..0d42300df 100644 --- a/app/reverse/portal_test.go +++ b/app/reverse/portal_test.go @@ -3,8 +3,8 @@ package reverse_test import ( "testing" - "github.com/xtls/xray-core/v1/app/reverse" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/app/reverse" + "github.com/xtls/xray-core/common" ) func TestStaticPickerEmpty(t *testing.T) { diff --git a/app/reverse/reverse.go b/app/reverse/reverse.go index c411fcf0f..55e24bcce 100644 --- a/app/reverse/reverse.go +++ b/app/reverse/reverse.go @@ -2,17 +2,17 @@ package reverse -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/features/routing" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/features/routing" ) const ( diff --git a/app/router/balancing.go b/app/router/balancing.go index 6e84a8057..b061fc1fb 100644 --- a/app/router/balancing.go +++ b/app/router/balancing.go @@ -3,8 +3,8 @@ package router import ( - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/features/outbound" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/features/outbound" ) type BalancingStrategy interface { diff --git a/app/router/command/command.go b/app/router/command/command.go index 322708f05..2e9be65e1 100644 --- a/app/router/command/command.go +++ b/app/router/command/command.go @@ -2,7 +2,7 @@ package command -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" @@ -10,10 +10,10 @@ import ( "google.golang.org/grpc" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/features/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/features/stats" ) // routingServer is an implementation of RoutingService. diff --git a/app/router/command/command.pb.go b/app/router/command/command.pb.go index fb3b94796..2017669df 100644 --- a/app/router/command/command.pb.go +++ b/app/router/command/command.pb.go @@ -8,7 +8,7 @@ package command import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" + net "github.com/xtls/xray-core/common/net" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -409,15 +409,14 @@ var file_app_router_command_command_proto_rawDesc = []byte{ 0x64, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x6f, 0x75, - 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x00, 0x42, 0x6a, 0x0a, + 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x00, 0x42, 0x67, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, - 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2f, + 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, - 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, - 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, - 0x02, 0x17, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, - 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, + 0x75, 0x74, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x17, 0x58, + 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/router/command/command.proto b/app/router/command/command.proto index 453797f74..5f7770448 100644 --- a/app/router/command/command.proto +++ b/app/router/command/command.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.router.command; option csharp_namespace = "Xray.App.Router.Command"; -option go_package = "github.com/xtls/xray-core/v1/app/router/command"; +option go_package = "github.com/xtls/xray-core/app/router/command"; option java_package = "com.xray.app.router.command"; option java_multiple_files = true; diff --git a/app/router/command/command_grpc.pb.go b/app/router/command/command_grpc.pb.go index 796212ddc..70c5c532f 100644 --- a/app/router/command/command_grpc.pb.go +++ b/app/router/command/command_grpc.pb.go @@ -100,6 +100,7 @@ type UnsafeRoutingServiceServer interface { func RegisterRoutingServiceServer(s grpc.ServiceRegistrar, srv RoutingServiceServer) { s.RegisterService(&_RoutingService_serviceDesc, srv) + s.RegisterService(&_RoutingService_serviceDesc2, srv) } func _RoutingService_SubscribeRoutingStats_Handler(srv interface{}, stream grpc.ServerStream) error { @@ -159,3 +160,22 @@ var _RoutingService_serviceDesc = grpc.ServiceDesc{ }, Metadata: "app/router/command/command.proto", } + +var _RoutingService_serviceDesc2 = grpc.ServiceDesc{ + ServiceName: "v2ray.core.app.router.command.RoutingService", + HandlerType: (*RoutingServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "TestRoute", + Handler: _RoutingService_TestRoute_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "SubscribeRoutingStats", + Handler: _RoutingService_SubscribeRoutingStats_Handler, + ServerStreams: true, + }, + }, + Metadata: "app/router/command/command.proto", +} diff --git a/app/router/command/command_test.go b/app/router/command/command_test.go index a609ba32a..e8e50cc65 100644 --- a/app/router/command/command_test.go +++ b/app/router/command/command_test.go @@ -8,13 +8,13 @@ import ( "github.com/golang/mock/gomock" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/xtls/xray-core/v1/app/router" - . "github.com/xtls/xray-core/v1/app/router/command" - "github.com/xtls/xray-core/v1/app/stats" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/testing/mocks" + "github.com/xtls/xray-core/app/router" + . "github.com/xtls/xray-core/app/router/command" + "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/testing/mocks" "google.golang.org/grpc" "google.golang.org/grpc/test/bufconn" ) diff --git a/app/router/command/config.go b/app/router/command/config.go index de0840b65..e95418dcf 100644 --- a/app/router/command/config.go +++ b/app/router/command/config.go @@ -3,8 +3,8 @@ package command import ( "strings" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features/routing" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features/routing" ) // routingContext is an wrapper of protobuf RoutingContext as implementation of routing.Context and routing.Route. diff --git a/app/router/command/errors.generated.go b/app/router/command/errors.generated.go index 76b46f511..a13059329 100644 --- a/app/router/command/errors.generated.go +++ b/app/router/command/errors.generated.go @@ -1,6 +1,6 @@ package command -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/router/condition.go b/app/router/condition.go index 7b4a8e8dd..afbe3345d 100644 --- a/app/router/condition.go +++ b/app/router/condition.go @@ -8,9 +8,9 @@ import ( "go.starlark.net/starlark" "go.starlark.net/syntax" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/strmatcher" - "github.com/xtls/xray-core/v1/features/routing" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/strmatcher" + "github.com/xtls/xray-core/features/routing" ) type Condition interface { diff --git a/app/router/condition_geoip.go b/app/router/condition_geoip.go index 005f4cd1f..e9cb0f29f 100644 --- a/app/router/condition_geoip.go +++ b/app/router/condition_geoip.go @@ -6,7 +6,7 @@ import ( "encoding/binary" "sort" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) type ipv6 struct { diff --git a/app/router/condition_geoip_test.go b/app/router/condition_geoip_test.go index b5d81ad8e..614cafa5c 100644 --- a/app/router/condition_geoip_test.go +++ b/app/router/condition_geoip_test.go @@ -6,11 +6,11 @@ import ( "testing" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/platform/filesystem" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/platform/filesystem" ) func init() { diff --git a/app/router/condition_test.go b/app/router/condition_test.go index a6096b83f..3f7185e66 100644 --- a/app/router/condition_test.go +++ b/app/router/condition_test.go @@ -8,17 +8,17 @@ import ( "github.com/golang/protobuf/proto" - . "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/platform/filesystem" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/protocol/http" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/features/routing" - routing_session "github.com/xtls/xray-core/v1/features/routing/session" + . "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/platform/filesystem" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/protocol/http" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/features/routing" + routing_session "github.com/xtls/xray-core/features/routing/session" ) func init() { diff --git a/app/router/config.go b/app/router/config.go index b965b5328..e4c18d54e 100644 --- a/app/router/config.go +++ b/app/router/config.go @@ -3,9 +3,9 @@ package router import ( - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/features/routing" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/features/routing" ) // CIDRList is an alias of []*CIDR to provide sort.Interface. diff --git a/app/router/config.pb.go b/app/router/config.pb.go index e8d569eb1..69abd3706 100644 --- a/app/router/config.pb.go +++ b/app/router/config.pb.go @@ -8,7 +8,7 @@ package router import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" + net "github.com/xtls/xray-core/common/net" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -1018,12 +1018,12 @@ var file_app_router_config_proto_rawDesc = []byte{ 0x73, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x73, 0x65, 0x49, 0x70, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x49, 0x70, 0x49, 0x66, 0x4e, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x70, 0x4f, 0x6e, 0x44, 0x65, 0x6d, 0x61, 0x6e, 0x64, 0x10, 0x03, - 0x42, 0x52, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, + 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, - 0x65, 0x72, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f, - 0x75, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0xaa, + 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, + 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/router/config.proto b/app/router/config.proto index d7a04f3cc..c5e655ade 100644 --- a/app/router/config.proto +++ b/app/router/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.router; option csharp_namespace = "Xray.App.Router"; -option go_package = "github.com/xtls/xray-core/v1/app/router"; +option go_package = "github.com/xtls/xray-core/app/router"; option java_package = "com.xray.app.router"; option java_multiple_files = true; diff --git a/app/router/errors.generated.go b/app/router/errors.generated.go index 76bbc9c78..1e5d74baf 100644 --- a/app/router/errors.generated.go +++ b/app/router/errors.generated.go @@ -1,6 +1,6 @@ package router -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/router/router.go b/app/router/router.go index bc9b4bf6a..2f7a28fc0 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -2,17 +2,17 @@ package router -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/features/routing" - routing_dns "github.com/xtls/xray-core/v1/features/routing/dns" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/features/routing" + routing_dns "github.com/xtls/xray-core/features/routing/dns" ) // Router is an implementation of routing.Router. diff --git a/app/router/router_test.go b/app/router/router_test.go index 7644cee91..cd0b7154c 100644 --- a/app/router/router_test.go +++ b/app/router/router_test.go @@ -5,13 +5,13 @@ import ( "testing" "github.com/golang/mock/gomock" - . "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/features/outbound" - routing_session "github.com/xtls/xray-core/v1/features/routing/session" - "github.com/xtls/xray-core/v1/testing/mocks" + . "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/features/outbound" + routing_session "github.com/xtls/xray-core/features/routing/session" + "github.com/xtls/xray-core/testing/mocks" ) type mockOutboundManager struct { diff --git a/app/stats/channel.go b/app/stats/channel.go index 298220298..6dca076d8 100644 --- a/app/stats/channel.go +++ b/app/stats/channel.go @@ -6,7 +6,7 @@ import ( "context" "sync" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) // Channel is an implementation of stats.Channel. diff --git a/app/stats/channel_test.go b/app/stats/channel_test.go index dc83711df..75764f0b7 100644 --- a/app/stats/channel_test.go +++ b/app/stats/channel_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - . "github.com/xtls/xray-core/v1/app/stats" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features/stats" + . "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features/stats" ) func TestStatsChannel(t *testing.T) { diff --git a/app/stats/command/command.go b/app/stats/command/command.go index eace983e6..03b85df30 100644 --- a/app/stats/command/command.go +++ b/app/stats/command/command.go @@ -2,7 +2,7 @@ package command -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" @@ -11,11 +11,11 @@ import ( grpc "google.golang.org/grpc" - "github.com/xtls/xray-core/v1/app/stats" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/strmatcher" - "github.com/xtls/xray-core/v1/core" - feature_stats "github.com/xtls/xray-core/v1/features/stats" + "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/strmatcher" + "github.com/xtls/xray-core/core" + feature_stats "github.com/xtls/xray-core/features/stats" ) // statsServer is an implementation of StatsService. diff --git a/app/stats/command/command.pb.go b/app/stats/command/command.pb.go index 8040b4706..23e279e8e 100644 --- a/app/stats/command/command.pb.go +++ b/app/stats/command/command.pb.go @@ -547,14 +547,14 @@ var file_app_stats_command_command_proto_rawDesc = []byte{ 0x79, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x53, 0x79, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x67, 0x0a, 0x1a, 0x63, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x64, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x73, 0x74, 0x61, - 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x16, 0x58, 0x72, 0x61, - 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x16, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, + 0x70, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/stats/command/command.proto b/app/stats/command/command.proto index 99f318164..bd1f9781d 100644 --- a/app/stats/command/command.proto +++ b/app/stats/command/command.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.stats.command; option csharp_namespace = "Xray.App.Stats.Command"; -option go_package = "github.com/xtls/xray-core/v1/app/stats/command"; +option go_package = "github.com/xtls/xray-core/app/stats/command"; option java_package = "com.xray.app.stats.command"; option java_multiple_files = true; diff --git a/app/stats/command/command_grpc.pb.go b/app/stats/command/command_grpc.pb.go index 149ee9960..1841a711f 100644 --- a/app/stats/command/command_grpc.pb.go +++ b/app/stats/command/command_grpc.pb.go @@ -91,6 +91,7 @@ type UnsafeStatsServiceServer interface { func RegisterStatsServiceServer(s grpc.ServiceRegistrar, srv StatsServiceServer) { s.RegisterService(&_StatsService_serviceDesc, srv) + s.RegisterService(&_StatsService_serviceDesc2, srv) } func _StatsService_GetStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -167,3 +168,24 @@ var _StatsService_serviceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "app/stats/command/command.proto", } + +var _StatsService_serviceDesc2 = grpc.ServiceDesc{ + ServiceName: "v2ray.core.app.stats.command.StatsService", + HandlerType: (*StatsServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetStats", + Handler: _StatsService_GetStats_Handler, + }, + { + MethodName: "QueryStats", + Handler: _StatsService_QueryStats_Handler, + }, + { + MethodName: "GetSysStats", + Handler: _StatsService_GetSysStats_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "app/stats/command/command.proto", +} diff --git a/app/stats/command/command_test.go b/app/stats/command/command_test.go index 2534b87c1..a58ba9823 100644 --- a/app/stats/command/command_test.go +++ b/app/stats/command/command_test.go @@ -7,9 +7,9 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/xtls/xray-core/v1/app/stats" - . "github.com/xtls/xray-core/v1/app/stats/command" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/app/stats" + . "github.com/xtls/xray-core/app/stats/command" + "github.com/xtls/xray-core/common" ) func TestGetStats(t *testing.T) { diff --git a/app/stats/command/errors.generated.go b/app/stats/command/errors.generated.go index 76b46f511..a13059329 100644 --- a/app/stats/command/errors.generated.go +++ b/app/stats/command/errors.generated.go @@ -1,6 +1,6 @@ package command -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/stats/config.pb.go b/app/stats/config.pb.go index cfb896bba..6640100c2 100644 --- a/app/stats/config.pb.go +++ b/app/stats/config.pb.go @@ -139,13 +139,12 @@ var file_app_stats_config_proto_rawDesc = []byte{ 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x42, - 0x75, 0x66, 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x4f, 0x0a, 0x12, 0x63, 0x6f, 0x6d, + 0x75, 0x66, 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x4c, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x50, - 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, - 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x61, 0x70, 0x70, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0xaa, 0x02, 0x0e, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x01, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, + 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, + 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0xaa, 0x02, 0x0e, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, + 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/stats/config.proto b/app/stats/config.proto index 3ba1e5518..378d4ee83 100644 --- a/app/stats/config.proto +++ b/app/stats/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.stats; option csharp_namespace = "Xray.App.Stats"; -option go_package = "github.com/xtls/xray-core/v1/app/stats"; +option go_package = "github.com/xtls/xray-core/app/stats"; option java_package = "com.xray.app.stats"; option java_multiple_files = true; diff --git a/app/stats/counter_test.go b/app/stats/counter_test.go index 32bcb66e7..811064685 100644 --- a/app/stats/counter_test.go +++ b/app/stats/counter_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - . "github.com/xtls/xray-core/v1/app/stats" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features/stats" + . "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features/stats" ) func TestStatsCounter(t *testing.T) { diff --git a/app/stats/errors.generated.go b/app/stats/errors.generated.go index d0bc052ad..c64386f32 100644 --- a/app/stats/errors.generated.go +++ b/app/stats/errors.generated.go @@ -1,6 +1,6 @@ package stats -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/stats/stats.go b/app/stats/stats.go index ef7d080d4..2b4c08035 100644 --- a/app/stats/stats.go +++ b/app/stats/stats.go @@ -2,15 +2,15 @@ package stats -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/features/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/features/stats" ) // Manager is an implementation of stats.Manager. diff --git a/app/stats/stats_test.go b/app/stats/stats_test.go index 3a5258186..cdbd404ea 100644 --- a/app/stats/stats_test.go +++ b/app/stats/stats_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" - . "github.com/xtls/xray-core/v1/app/stats" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features/stats" + . "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features/stats" ) func TestInterface(t *testing.T) { diff --git a/common/bitmask/byte_test.go b/common/bitmask/byte_test.go index f9f46cfee..efce1be9c 100644 --- a/common/bitmask/byte_test.go +++ b/common/bitmask/byte_test.go @@ -3,7 +3,7 @@ package bitmask_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/bitmask" + . "github.com/xtls/xray-core/common/bitmask" ) func TestBitmaskByte(t *testing.T) { diff --git a/common/buf/buf.go b/common/buf/buf.go index a00049058..dde7e22ce 100644 --- a/common/buf/buf.go +++ b/common/buf/buf.go @@ -1,4 +1,4 @@ // Package buf provides a light-weight memory allocation mechanism. -package buf // import "github.com/xtls/xray-core/v1/common/buf" +package buf // import "github.com/xtls/xray-core/common/buf" -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/common/buf/buffer.go b/common/buf/buffer.go index f8298e5a4..2fa43ec58 100644 --- a/common/buf/buffer.go +++ b/common/buf/buffer.go @@ -3,7 +3,7 @@ package buf import ( "io" - "github.com/xtls/xray-core/v1/common/bytespool" + "github.com/xtls/xray-core/common/bytespool" ) const ( diff --git a/common/buf/buffer_test.go b/common/buf/buffer_test.go index ebaf8ea0d..811ef0c7a 100644 --- a/common/buf/buffer_test.go +++ b/common/buf/buffer_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/buf" ) func TestBufferClear(t *testing.T) { diff --git a/common/buf/copy.go b/common/buf/copy.go index a01a06386..dfacda36b 100644 --- a/common/buf/copy.go +++ b/common/buf/copy.go @@ -4,8 +4,8 @@ import ( "io" "time" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/signal" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/signal" ) type dataHandler func(MultiBuffer) diff --git a/common/buf/copy_test.go b/common/buf/copy_test.go index 98c5c055f..e5cd5ecee 100644 --- a/common/buf/copy_test.go +++ b/common/buf/copy_test.go @@ -7,9 +7,9 @@ import ( "github.com/golang/mock/gomock" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/testing/mocks" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/testing/mocks" ) func TestReadError(t *testing.T) { diff --git a/common/buf/errors.generated.go b/common/buf/errors.generated.go index 3c44bcefb..032c0701c 100644 --- a/common/buf/errors.generated.go +++ b/common/buf/errors.generated.go @@ -1,6 +1,6 @@ package buf -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/buf/io_test.go b/common/buf/io_test.go index 40fdb9fdd..d48304eaf 100644 --- a/common/buf/io_test.go +++ b/common/buf/io_test.go @@ -5,9 +5,9 @@ import ( "io" "testing" - . "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + . "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/testing/servers/tcp" ) func TestWriterCreation(t *testing.T) { diff --git a/common/buf/multi_buffer.go b/common/buf/multi_buffer.go index 9be6c0af2..636eeb3a6 100644 --- a/common/buf/multi_buffer.go +++ b/common/buf/multi_buffer.go @@ -3,9 +3,9 @@ package buf import ( "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/serial" ) // ReadAllToBytes reads all content from the reader into a byte array, until EOF. diff --git a/common/buf/multi_buffer_test.go b/common/buf/multi_buffer_test.go index 1cff7758c..bdcd6e347 100644 --- a/common/buf/multi_buffer_test.go +++ b/common/buf/multi_buffer_test.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/buf" ) func TestMultiBufferRead(t *testing.T) { diff --git a/common/buf/reader.go b/common/buf/reader.go index 432dd1aa5..3e35ad629 100644 --- a/common/buf/reader.go +++ b/common/buf/reader.go @@ -3,8 +3,8 @@ package buf import ( "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" ) func readOneUDP(r io.Reader) (*Buffer, error) { diff --git a/common/buf/reader_test.go b/common/buf/reader_test.go index 800201db2..d2e951693 100644 --- a/common/buf/reader_test.go +++ b/common/buf/reader_test.go @@ -6,9 +6,9 @@ import ( "strings" "testing" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/transport/pipe" ) func TestBytesReaderWriteTo(t *testing.T) { diff --git a/common/buf/readv_reader.go b/common/buf/readv_reader.go index 0107d7a7a..0cbac072a 100644 --- a/common/buf/readv_reader.go +++ b/common/buf/readv_reader.go @@ -7,7 +7,7 @@ import ( "runtime" "syscall" - "github.com/xtls/xray-core/v1/common/platform" + "github.com/xtls/xray-core/common/platform" ) type allocStrategy struct { diff --git a/common/buf/readv_test.go b/common/buf/readv_test.go index 553e9b932..d8186659f 100644 --- a/common/buf/readv_test.go +++ b/common/buf/readv_test.go @@ -9,9 +9,9 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/testing/servers/tcp" "golang.org/x/sync/errgroup" ) diff --git a/common/buf/writer.go b/common/buf/writer.go index 169c9bb8a..a3bfe560a 100644 --- a/common/buf/writer.go +++ b/common/buf/writer.go @@ -5,8 +5,8 @@ import ( "net" "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" ) // BufferToBytesWriter is a Writer that writes alloc.Buffer into underlying writer. diff --git a/common/buf/writer_test.go b/common/buf/writer_test.go index f28fef021..686527f5d 100644 --- a/common/buf/writer_test.go +++ b/common/buf/writer_test.go @@ -9,9 +9,9 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/transport/pipe" ) func TestWriter(t *testing.T) { diff --git a/common/common.go b/common/common.go index 6173efded..97cac83b2 100644 --- a/common/common.go +++ b/common/common.go @@ -10,10 +10,10 @@ import ( "path/filepath" "strings" - "github.com/xtls/xray-core/v1/common/errors" + "github.com/xtls/xray-core/common/errors" ) -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen var ( // 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. diff --git a/common/common_test.go b/common/common_test.go index b8992887d..d661788cd 100644 --- a/common/common_test.go +++ b/common/common_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - . "github.com/xtls/xray-core/v1/common" + . "github.com/xtls/xray-core/common" ) func TestMust(t *testing.T) { diff --git a/common/crypto/aes.go b/common/crypto/aes.go index 547b036d6..3205a2079 100644 --- a/common/crypto/aes.go +++ b/common/crypto/aes.go @@ -4,7 +4,7 @@ import ( "crypto/aes" "crypto/cipher" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) // NewAesDecryptionStream creates a new AES encryption stream based on given key and IV. diff --git a/common/crypto/auth.go b/common/crypto/auth.go index e17b3efa9..fc72405f6 100644 --- a/common/crypto/auth.go +++ b/common/crypto/auth.go @@ -5,10 +5,10 @@ import ( "io" "math/rand" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/bytespool" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/bytespool" + "github.com/xtls/xray-core/common/protocol" ) type BytesGenerator func() []byte diff --git a/common/crypto/auth_test.go b/common/crypto/auth_test.go index 5a389f044..0f293b9ac 100644 --- a/common/crypto/auth_test.go +++ b/common/crypto/auth_test.go @@ -10,10 +10,10 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/common/crypto" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/protocol" ) func TestAuthenticationReaderWriter(t *testing.T) { diff --git a/common/crypto/benchmark_test.go b/common/crypto/benchmark_test.go index faffa333d..1f30c8021 100644 --- a/common/crypto/benchmark_test.go +++ b/common/crypto/benchmark_test.go @@ -4,7 +4,7 @@ import ( "crypto/cipher" "testing" - . "github.com/xtls/xray-core/v1/common/crypto" + . "github.com/xtls/xray-core/common/crypto" ) const benchSize = 1024 * 1024 diff --git a/common/crypto/chacha20.go b/common/crypto/chacha20.go index 1015030e2..87273c3cc 100644 --- a/common/crypto/chacha20.go +++ b/common/crypto/chacha20.go @@ -3,7 +3,7 @@ package crypto import ( "crypto/cipher" - "github.com/xtls/xray-core/v1/common/crypto/internal" + "github.com/xtls/xray-core/common/crypto/internal" ) // NewChaCha20Stream creates a new Chacha20 encryption/descryption stream based on give key and IV. diff --git a/common/crypto/chacha20_test.go b/common/crypto/chacha20_test.go index 474ed1962..e1237da48 100644 --- a/common/crypto/chacha20_test.go +++ b/common/crypto/chacha20_test.go @@ -7,8 +7,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/crypto" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/crypto" ) func mustDecodeHex(s string) []byte { diff --git a/common/crypto/chunk.go b/common/crypto/chunk.go index 657d8c0f9..9cd481815 100644 --- a/common/crypto/chunk.go +++ b/common/crypto/chunk.go @@ -4,8 +4,8 @@ import ( "encoding/binary" "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" ) // ChunkSizeDecoder is a utility class to decode size value from bytes. diff --git a/common/crypto/chunk_test.go b/common/crypto/chunk_test.go index ddfba889b..7f874f3d3 100644 --- a/common/crypto/chunk_test.go +++ b/common/crypto/chunk_test.go @@ -5,9 +5,9 @@ import ( "io" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/common/crypto" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/common/crypto" ) func TestChunkStreamIO(t *testing.T) { diff --git a/common/crypto/crypto.go b/common/crypto/crypto.go index 96ee32d78..a7ed1a4a4 100644 --- a/common/crypto/crypto.go +++ b/common/crypto/crypto.go @@ -1,4 +1,4 @@ // Package crypto provides common crypto libraries for Xray. -package crypto // import "github.com/xtls/xray-core/v1/common/crypto" +package crypto // import "github.com/xtls/xray-core/common/crypto" -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/common/crypto/errors.generated.go b/common/crypto/errors.generated.go index bc627cb2b..2d983f89a 100644 --- a/common/crypto/errors.generated.go +++ b/common/crypto/errors.generated.go @@ -1,6 +1,6 @@ package crypto -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/crypto/io.go b/common/crypto/io.go index f06ca7b52..9800c6a50 100644 --- a/common/crypto/io.go +++ b/common/crypto/io.go @@ -4,7 +4,7 @@ import ( "crypto/cipher" "io" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) type CryptionReader struct { diff --git a/common/dice/dice.go b/common/dice/dice.go index 69fcc240c..896c1e8e8 100644 --- a/common/dice/dice.go +++ b/common/dice/dice.go @@ -1,6 +1,6 @@ // Package dice contains common functions to generate random number. // It also initialize math/rand with the time in seconds at launch time. -package dice // import "github.com/xtls/xray-core/v1/common/dice" +package dice // import "github.com/xtls/xray-core/common/dice" import ( "math/rand" diff --git a/common/dice/dice_test.go b/common/dice/dice_test.go index 9cf41ee3c..02eba57b6 100644 --- a/common/dice/dice_test.go +++ b/common/dice/dice_test.go @@ -4,7 +4,7 @@ import ( "math/rand" "testing" - . "github.com/xtls/xray-core/v1/common/dice" + . "github.com/xtls/xray-core/common/dice" ) func BenchmarkRoll1(b *testing.B) { diff --git a/common/errors.generated.go b/common/errors.generated.go index 9d6c1cc34..28b9a6255 100644 --- a/common/errors.generated.go +++ b/common/errors.generated.go @@ -1,6 +1,6 @@ package common -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/errors/errorgen/main.go b/common/errors/errorgen/main.go index 1fb8ef789..bb12ed783 100644 --- a/common/errors/errorgen/main.go +++ b/common/errors/errorgen/main.go @@ -6,7 +6,7 @@ import ( "os" "path/filepath" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) func main() { diff --git a/common/errors/errors.go b/common/errors/errors.go index 4b843be8e..bb5ac2c85 100644 --- a/common/errors/errors.go +++ b/common/errors/errors.go @@ -1,15 +1,17 @@ // Package errors is a drop-in replacement for Golang lib 'errors'. -package errors // import "github.com/xtls/xray-core/v1/common/errors" +package errors // import "github.com/xtls/xray-core/common/errors" import ( "os" "reflect" "strings" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/serial" ) +const trim = len("github.com/xtls/xray-core/") + type hasInnerError interface { // Inner returns the underlying error of this one. Inner() error @@ -37,7 +39,7 @@ func (err *Error) pkgPath() string { if err.pathObj == nil { return "" } - return reflect.TypeOf(err.pathObj).PkgPath() + return reflect.TypeOf(err.pathObj).PkgPath()[trim:] } // Error implements error.Error(). diff --git a/common/errors/errors_test.go b/common/errors/errors_test.go index 5d87aca4d..875376961 100644 --- a/common/errors/errors_test.go +++ b/common/errors/errors_test.go @@ -7,8 +7,8 @@ import ( "github.com/google/go-cmp/cmp" - . "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/log" + . "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/log" ) func TestError(t *testing.T) { @@ -46,11 +46,11 @@ func TestErrorMessage(t *testing.T) { }{ { err: New("a").Base(New("b")).WithPathObj(e{}), - msg: "github.com/xtls/xray-core/v1/common/errors_test: a > b", + msg: "common/errors_test: a > b", }, { err: New("a").Base(New("b").WithPathObj(e{})), - msg: "a > github.com/xtls/xray-core/v1/common/errors_test: b", + msg: "a > common/errors_test: b", }, } diff --git a/common/interfaces.go b/common/interfaces.go index 8d881e7dc..80796a080 100644 --- a/common/interfaces.go +++ b/common/interfaces.go @@ -1,6 +1,6 @@ package common -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" // Closable is the interface for objects that can release its resources. // diff --git a/common/log/access.go b/common/log/access.go index c46dfda13..87bc1afea 100644 --- a/common/log/access.go +++ b/common/log/access.go @@ -4,7 +4,7 @@ import ( "context" "strings" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common/serial" ) type logKey int diff --git a/common/log/log.go b/common/log/log.go index 49dad3c2b..3d478755e 100644 --- a/common/log/log.go +++ b/common/log/log.go @@ -1,9 +1,9 @@ -package log // import "github.com/xtls/xray-core/v1/common/log" +package log // import "github.com/xtls/xray-core/common/log" import ( "sync" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common/serial" ) // Message is the interface for all log messages. diff --git a/common/log/log.pb.go b/common/log/log.pb.go index 9c6f06c52..4daf5de29 100644 --- a/common/log/log.pb.go +++ b/common/log/log.pb.go @@ -89,13 +89,13 @@ var file_common_log_log_proto_rawDesc = []byte{ 0x69, 0x74, 0x79, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, - 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, 0x67, 0x10, 0x04, 0x42, 0x52, 0x0a, + 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, 0x67, 0x10, 0x04, 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x6c, 0x6f, 0x67, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x2e, 0x6c, 0x6f, 0x67, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, - 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6c, 0x6f, 0x67, 0xaa, - 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x6f, - 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6c, 0x6f, 0x67, 0xaa, 0x02, 0x0f, 0x58, + 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/log/log.proto b/common/log/log.proto index c5e83e202..e2145dc80 100644 --- a/common/log/log.proto +++ b/common/log/log.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.log; option csharp_namespace = "Xray.Common.Log"; -option go_package = "github.com/xtls/xray-core/v1/common/log"; +option go_package = "github.com/xtls/xray-core/common/log"; option java_package = "com.xray.common.log"; option java_multiple_files = true; diff --git a/common/log/log_test.go b/common/log/log_test.go index 38b6b2687..28c473257 100644 --- a/common/log/log_test.go +++ b/common/log/log_test.go @@ -5,8 +5,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" ) type testLogger struct { diff --git a/common/log/logger.go b/common/log/logger.go index e581be01f..6899fef5d 100644 --- a/common/log/logger.go +++ b/common/log/logger.go @@ -6,9 +6,9 @@ import ( "os" "time" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/common/signal/semaphore" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/common/signal/semaphore" ) // Writer is the interface for writing logs. diff --git a/common/log/logger_test.go b/common/log/logger_test.go index 6ab91bf7e..4ad7aee70 100644 --- a/common/log/logger_test.go +++ b/common/log/logger_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/common/log" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/common/log" ) func TestFileLogger(t *testing.T) { diff --git a/common/mux/client.go b/common/mux/client.go index 0395e36f7..a3b5337f2 100644 --- a/common/mux/client.go +++ b/common/mux/client.go @@ -6,18 +6,18 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/proxy" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/proxy" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/pipe" ) type ClientManager struct { diff --git a/common/mux/client_test.go b/common/mux/client_test.go index e31b9c4b0..7837a86e7 100644 --- a/common/mux/client_test.go +++ b/common/mux/client_test.go @@ -6,14 +6,14 @@ import ( "time" "github.com/golang/mock/gomock" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/testing/mocks" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/testing/mocks" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/pipe" ) func TestIncrementalPickerFailure(t *testing.T) { diff --git a/common/mux/errors.generated.go b/common/mux/errors.generated.go index 39cdfd1a0..9318ceac2 100644 --- a/common/mux/errors.generated.go +++ b/common/mux/errors.generated.go @@ -1,6 +1,6 @@ package mux -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/mux/frame.go b/common/mux/frame.go index 398ac42bd..5e9c77d01 100644 --- a/common/mux/frame.go +++ b/common/mux/frame.go @@ -4,12 +4,12 @@ import ( "encoding/binary" "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/bitmask" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/bitmask" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" ) type SessionStatus byte diff --git a/common/mux/frame_test.go b/common/mux/frame_test.go index e81c4d6e4..e6d54ff16 100644 --- a/common/mux/frame_test.go +++ b/common/mux/frame_test.go @@ -3,10 +3,10 @@ package mux_test import ( "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" ) func BenchmarkFrameWrite(b *testing.B) { diff --git a/common/mux/mux.go b/common/mux/mux.go index db41742a0..0eaebf512 100644 --- a/common/mux/mux.go +++ b/common/mux/mux.go @@ -1,3 +1,3 @@ package mux -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/common/mux/mux_test.go b/common/mux/mux_test.go index c5e9ab796..282ff2102 100644 --- a/common/mux/mux_test.go +++ b/common/mux/mux_test.go @@ -6,12 +6,12 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/transport/pipe" ) func readAll(reader buf.Reader) (buf.MultiBuffer, error) { diff --git a/common/mux/reader.go b/common/mux/reader.go index 31f391326..1013fcd02 100644 --- a/common/mux/reader.go +++ b/common/mux/reader.go @@ -3,9 +3,9 @@ package mux import ( "io" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/crypto" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/serial" ) // PacketReader is an io.Reader that reads whole chunk of Mux frames every time. diff --git a/common/mux/server.go b/common/mux/server.go index 1bf96dd26..0eccb6f24 100644 --- a/common/mux/server.go +++ b/common/mux/server.go @@ -4,17 +4,17 @@ import ( "context" "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/pipe" ) type Server struct { diff --git a/common/mux/session.go b/common/mux/session.go index 2d009a4cd..8237a1fe4 100644 --- a/common/mux/session.go +++ b/common/mux/session.go @@ -3,9 +3,9 @@ package mux import ( "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/protocol" ) type SessionManager struct { diff --git a/common/mux/session_test.go b/common/mux/session_test.go index 2719fe28c..7139df109 100644 --- a/common/mux/session_test.go +++ b/common/mux/session_test.go @@ -3,7 +3,7 @@ package mux_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/mux" + . "github.com/xtls/xray-core/common/mux" ) func TestSessionManagerAdd(t *testing.T) { diff --git a/common/mux/writer.go b/common/mux/writer.go index 48455bc43..492cc693a 100644 --- a/common/mux/writer.go +++ b/common/mux/writer.go @@ -1,11 +1,11 @@ package mux import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" ) type Writer struct { diff --git a/common/net/address.pb.go b/common/net/address.pb.go index 890d2ff33..d838e094f 100644 --- a/common/net/address.pb.go +++ b/common/net/address.pb.go @@ -119,12 +119,12 @@ var file_common_net_address_proto_rawDesc = []byte{ 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x02, 0x69, 0x70, 0x12, 0x18, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x42, 0x52, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, - 0x65, 0x74, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0xaa, + 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, + 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/net/address.proto b/common/net/address.proto index 0498a1dea..d83f0dfe4 100644 --- a/common/net/address.proto +++ b/common/net/address.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.net; option csharp_namespace = "Xray.Common.Net"; -option go_package = "github.com/xtls/xray-core/v1/common/net"; +option go_package = "github.com/xtls/xray-core/common/net"; option java_package = "com.xray.common.net"; option java_multiple_files = true; diff --git a/common/net/address_test.go b/common/net/address_test.go index 0fe4adb15..1fec36715 100644 --- a/common/net/address_test.go +++ b/common/net/address_test.go @@ -6,7 +6,7 @@ import ( "github.com/google/go-cmp/cmp" - . "github.com/xtls/xray-core/v1/common/net" + . "github.com/xtls/xray-core/common/net" ) func TestAddressProperty(t *testing.T) { diff --git a/common/net/connection.go b/common/net/connection.go index bdf4dde4f..563d81a34 100644 --- a/common/net/connection.go +++ b/common/net/connection.go @@ -7,9 +7,9 @@ import ( "net" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/signal/done" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/signal/done" ) type ConnectionOption func(*connection) diff --git a/common/net/destination.pb.go b/common/net/destination.pb.go index 3f323d78b..0eeb1ec53 100644 --- a/common/net/destination.pb.go +++ b/common/net/destination.pb.go @@ -107,12 +107,12 @@ var file_common_net_destination_proto_rawDesc = []byte{ 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x49, 0x50, 0x4f, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x42, - 0x52, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, - 0x74, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0xaa, 0x02, + 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/net/destination.proto b/common/net/destination.proto index e8c1f6381..c6c4230ed 100644 --- a/common/net/destination.proto +++ b/common/net/destination.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.net; option csharp_namespace = "Xray.Common.Net"; -option go_package = "github.com/xtls/xray-core/v1/common/net"; +option go_package = "github.com/xtls/xray-core/common/net"; option java_package = "com.xray.common.net"; option java_multiple_files = true; diff --git a/common/net/destination_test.go b/common/net/destination_test.go index a4a008ec7..f6b19a4ce 100644 --- a/common/net/destination_test.go +++ b/common/net/destination_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/go-cmp/cmp" - . "github.com/xtls/xray-core/v1/common/net" + . "github.com/xtls/xray-core/common/net" ) func TestDestinationProperty(t *testing.T) { diff --git a/common/net/errors.generated.go b/common/net/errors.generated.go index cb133cbe2..fb64eac50 100644 --- a/common/net/errors.generated.go +++ b/common/net/errors.generated.go @@ -1,6 +1,6 @@ package net -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/net/net.go b/common/net/net.go index 961058206..5027617c0 100644 --- a/common/net/net.go +++ b/common/net/net.go @@ -1,4 +1,4 @@ // Package net is a drop-in replacement to Golang's net package, with some more functionalities. -package net // import "github.com/xtls/xray-core/v1/common/net" +package net // import "github.com/xtls/xray-core/common/net" -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/common/net/network.pb.go b/common/net/network.pb.go index b59d43003..1eb88b6d7 100644 --- a/common/net/network.pb.go +++ b/common/net/network.pb.go @@ -143,12 +143,12 @@ var file_common_net_network_proto_rawDesc = []byte{ 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x06, 0x52, 0x61, 0x77, 0x54, 0x43, 0x50, 0x10, 0x01, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x43, 0x50, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x55, 0x44, 0x50, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x4e, 0x49, 0x58, - 0x10, 0x04, 0x42, 0x52, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, + 0x10, 0x04, 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, - 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, + 0x74, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/net/network.proto b/common/net/network.proto index 205149e31..f2487fbc0 100644 --- a/common/net/network.proto +++ b/common/net/network.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.net; option csharp_namespace = "Xray.Common.Net"; -option go_package = "github.com/xtls/xray-core/v1/common/net"; +option go_package = "github.com/xtls/xray-core/common/net"; option java_package = "com.xray.common.net"; option java_multiple_files = true; diff --git a/common/net/port.pb.go b/common/net/port.pb.go index 0ed67140e..5f8cf2c1a 100644 --- a/common/net/port.pb.go +++ b/common/net/port.pb.go @@ -143,13 +143,12 @@ var file_common_net_port_proto_rawDesc = []byte{ 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x52, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, + 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, - 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, - 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, + 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/net/port.proto b/common/net/port.proto index b18df0c45..0b626f9ee 100644 --- a/common/net/port.proto +++ b/common/net/port.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.net; option csharp_namespace = "Xray.Common.Net"; -option go_package = "github.com/xtls/xray-core/v1/common/net"; +option go_package = "github.com/xtls/xray-core/common/net"; option java_package = "com.xray.common.net"; option java_multiple_files = true; diff --git a/common/net/port_test.go b/common/net/port_test.go index cd66ac9bc..23201f973 100644 --- a/common/net/port_test.go +++ b/common/net/port_test.go @@ -3,7 +3,7 @@ package net_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/net" + . "github.com/xtls/xray-core/common/net" ) func TestPortRangeContains(t *testing.T) { diff --git a/common/platform/ctlcmd/ctlcmd.go b/common/platform/ctlcmd/ctlcmd.go index 845a10be2..ad9550fab 100644 --- a/common/platform/ctlcmd/ctlcmd.go +++ b/common/platform/ctlcmd/ctlcmd.go @@ -6,11 +6,11 @@ import ( "os/exec" "strings" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/platform" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/platform" ) -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//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") diff --git a/common/platform/ctlcmd/errors.generated.go b/common/platform/ctlcmd/errors.generated.go index 618c7f23a..c861825c5 100644 --- a/common/platform/ctlcmd/errors.generated.go +++ b/common/platform/ctlcmd/errors.generated.go @@ -1,6 +1,6 @@ package ctlcmd -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/platform/filesystem/file.go b/common/platform/filesystem/file.go index bfaf6f7df..632694a85 100644 --- a/common/platform/filesystem/file.go +++ b/common/platform/filesystem/file.go @@ -4,8 +4,8 @@ import ( "io" "os" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/platform" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/platform" ) type FileReaderFunc func(path string) (io.ReadCloser, error) diff --git a/common/platform/platform.go b/common/platform/platform.go index 2370a445f..d5149db4b 100644 --- a/common/platform/platform.go +++ b/common/platform/platform.go @@ -1,4 +1,4 @@ -package platform // import "github.com/xtls/xray-core/v1/common/platform" +package platform // import "github.com/xtls/xray-core/common/platform" import ( "os" diff --git a/common/platform/platform_test.go b/common/platform/platform_test.go index b3196f152..ae823217c 100644 --- a/common/platform/platform_test.go +++ b/common/platform/platform_test.go @@ -6,8 +6,8 @@ import ( "runtime" "testing" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/platform" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/platform" ) func TestNormalizeEnvName(t *testing.T) { diff --git a/common/protocol/address.go b/common/protocol/address.go index 74b04602f..cf52a3803 100644 --- a/common/protocol/address.go +++ b/common/protocol/address.go @@ -3,10 +3,10 @@ package protocol import ( "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" ) type AddressOption func(*option) diff --git a/common/protocol/address_test.go b/common/protocol/address_test.go index 508db8094..4733ea3d0 100644 --- a/common/protocol/address_test.go +++ b/common/protocol/address_test.go @@ -6,10 +6,10 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/common/protocol" ) func TestAddressReading(t *testing.T) { diff --git a/common/protocol/bittorrent/bittorrent.go b/common/protocol/bittorrent/bittorrent.go index dee5816f8..0ffc56a3e 100644 --- a/common/protocol/bittorrent/bittorrent.go +++ b/common/protocol/bittorrent/bittorrent.go @@ -3,7 +3,7 @@ package bittorrent import ( "errors" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) type SniffHeader struct { diff --git a/common/protocol/dns/errors.generated.go b/common/protocol/dns/errors.generated.go index ce4c0605e..d7375a9b9 100644 --- a/common/protocol/dns/errors.generated.go +++ b/common/protocol/dns/errors.generated.go @@ -1,6 +1,6 @@ package dns -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/protocol/dns/io.go b/common/protocol/dns/io.go index deeb8bb48..0c215a702 100644 --- a/common/protocol/dns/io.go +++ b/common/protocol/dns/io.go @@ -4,9 +4,9 @@ import ( "encoding/binary" "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/serial" "golang.org/x/net/dns/dnsmessage" ) diff --git a/common/protocol/errors.generated.go b/common/protocol/errors.generated.go index d09ca6a42..694dd6677 100644 --- a/common/protocol/errors.generated.go +++ b/common/protocol/errors.generated.go @@ -1,6 +1,6 @@ package protocol -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/protocol/headers.go b/common/protocol/headers.go index 60e5da13c..921b4d329 100644 --- a/common/protocol/headers.go +++ b/common/protocol/headers.go @@ -3,9 +3,9 @@ package protocol import ( "runtime" - "github.com/xtls/xray-core/v1/common/bitmask" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common/bitmask" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/uuid" ) // RequestCommand is a custom command in a proxy request. diff --git a/common/protocol/headers.pb.go b/common/protocol/headers.pb.go index 11a2e6cb3..eaa04d7e0 100644 --- a/common/protocol/headers.pb.go +++ b/common/protocol/headers.pb.go @@ -147,13 +147,13 @@ var file_common_protocol_headers_proto_rawDesc = []byte{ 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x45, 0x53, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, 0x4d, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x48, 0x41, 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x10, 0x04, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, - 0x45, 0x10, 0x05, 0x42, 0x61, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, + 0x45, 0x10, 0x05, 0x42, 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x50, - 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, - 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, - 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, + 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x14, 0x58, + 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/protocol/headers.proto b/common/protocol/headers.proto index 78150e64e..8c1a957f4 100644 --- a/common/protocol/headers.proto +++ b/common/protocol/headers.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.protocol; option csharp_namespace = "Xray.Common.Protocol"; -option go_package = "github.com/xtls/xray-core/v1/common/protocol"; +option go_package = "github.com/xtls/xray-core/common/protocol"; option java_package = "com.xray.common.protocol"; option java_multiple_files = true; diff --git a/common/protocol/http/headers.go b/common/protocol/http/headers.go index ee16467a8..e03464269 100644 --- a/common/protocol/http/headers.go +++ b/common/protocol/http/headers.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) // ParseXForwardedFor parses X-Forwarded-For header in http headers, and return the IP list in it. diff --git a/common/protocol/http/headers_test.go b/common/protocol/http/headers_test.go index ee9d5ef3b..80a0402b8 100644 --- a/common/protocol/http/headers_test.go +++ b/common/protocol/http/headers_test.go @@ -8,9 +8,9 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/common/protocol/http" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/common/protocol/http" ) func TestParseXForwardedFor(t *testing.T) { diff --git a/common/protocol/http/sniff.go b/common/protocol/http/sniff.go index 4cb42d820..ceedede24 100644 --- a/common/protocol/http/sniff.go +++ b/common/protocol/http/sniff.go @@ -5,8 +5,8 @@ import ( "errors" "strings" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" ) type version byte diff --git a/common/protocol/http/sniff_test.go b/common/protocol/http/sniff_test.go index dca249a8c..fff66415d 100644 --- a/common/protocol/http/sniff_test.go +++ b/common/protocol/http/sniff_test.go @@ -3,7 +3,7 @@ package http_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/protocol/http" + . "github.com/xtls/xray-core/common/protocol/http" ) func TestHTTPHeaders(t *testing.T) { diff --git a/common/protocol/id.go b/common/protocol/id.go index a46f9128c..2a1eb17ad 100644 --- a/common/protocol/id.go +++ b/common/protocol/id.go @@ -5,8 +5,8 @@ import ( "crypto/md5" "hash" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/uuid" ) const ( diff --git a/common/protocol/id_test.go b/common/protocol/id_test.go index 1d6cb7d2f..c2d6dad6d 100644 --- a/common/protocol/id_test.go +++ b/common/protocol/id_test.go @@ -3,8 +3,8 @@ package protocol_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" + . "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" ) func TestIdEquals(t *testing.T) { diff --git a/common/protocol/protocol.go b/common/protocol/protocol.go index dc52c2a78..bd49ba69b 100644 --- a/common/protocol/protocol.go +++ b/common/protocol/protocol.go @@ -1,3 +1,3 @@ -package protocol // import "github.com/xtls/xray-core/v1/common/protocol" +package protocol // import "github.com/xtls/xray-core/common/protocol" -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/common/protocol/server_picker_test.go b/common/protocol/server_picker_test.go index 674293a34..8919b10bf 100644 --- a/common/protocol/server_picker_test.go +++ b/common/protocol/server_picker_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/common/protocol" ) func TestServerList(t *testing.T) { diff --git a/common/protocol/server_spec.go b/common/protocol/server_spec.go index f950b1cc8..24b778bb1 100644 --- a/common/protocol/server_spec.go +++ b/common/protocol/server_spec.go @@ -4,8 +4,8 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/net" ) type ValidationStrategy interface { diff --git a/common/protocol/server_spec.pb.go b/common/protocol/server_spec.pb.go index 5bc2d39c4..54b9fa9c8 100644 --- a/common/protocol/server_spec.pb.go +++ b/common/protocol/server_spec.pb.go @@ -8,7 +8,7 @@ package protocol import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" + net "github.com/xtls/xray-core/common/net" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -107,14 +107,14 @@ var file_common_protocol_server_spec_proto_rawDesc = []byte{ 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0x61, 0x0a, + 0x6f, 0x6c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, - 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/protocol/server_spec.proto b/common/protocol/server_spec.proto index 7753b943c..6b9cc04c9 100644 --- a/common/protocol/server_spec.proto +++ b/common/protocol/server_spec.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.protocol; option csharp_namespace = "Xray.Common.Protocol"; -option go_package = "github.com/xtls/xray-core/v1/common/protocol"; +option go_package = "github.com/xtls/xray-core/common/protocol"; option java_package = "com.xray.common.protocol"; option java_multiple_files = true; diff --git a/common/protocol/server_spec_test.go b/common/protocol/server_spec_test.go index 7b42b65ed..10dfb8c57 100644 --- a/common/protocol/server_spec_test.go +++ b/common/protocol/server_spec_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/proxy/vmess" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/proxy/vmess" ) func TestAlwaysValidStrategy(t *testing.T) { diff --git a/common/protocol/time.go b/common/protocol/time.go index 1cef8fb43..195496ed4 100644 --- a/common/protocol/time.go +++ b/common/protocol/time.go @@ -3,7 +3,7 @@ package protocol import ( "time" - "github.com/xtls/xray-core/v1/common/dice" + "github.com/xtls/xray-core/common/dice" ) type Timestamp int64 diff --git a/common/protocol/time_test.go b/common/protocol/time_test.go index 45a32d2ab..9031b4141 100644 --- a/common/protocol/time_test.go +++ b/common/protocol/time_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - . "github.com/xtls/xray-core/v1/common/protocol" + . "github.com/xtls/xray-core/common/protocol" ) func TestGenerateRandomInt64InRange(t *testing.T) { diff --git a/common/protocol/tls/cert/cert.go b/common/protocol/tls/cert/cert.go index cf19ca67c..cd8e56f5e 100644 --- a/common/protocol/tls/cert/cert.go +++ b/common/protocol/tls/cert/cert.go @@ -12,10 +12,10 @@ import ( "math/big" "time" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen type Certificate struct { // Cerificate in ASN.1 DER format diff --git a/common/protocol/tls/cert/cert_test.go b/common/protocol/tls/cert/cert_test.go index 7f92488a3..3a1ef8ff9 100644 --- a/common/protocol/tls/cert/cert_test.go +++ b/common/protocol/tls/cert/cert_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/task" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/task" ) func TestGenerate(t *testing.T) { diff --git a/common/protocol/tls/cert/errors.generated.go b/common/protocol/tls/cert/errors.generated.go index 20e2effd9..6a4677f4d 100644 --- a/common/protocol/tls/cert/errors.generated.go +++ b/common/protocol/tls/cert/errors.generated.go @@ -1,6 +1,6 @@ package cert -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/protocol/tls/sniff.go b/common/protocol/tls/sniff.go index 2d90268b4..a8fec15fc 100644 --- a/common/protocol/tls/sniff.go +++ b/common/protocol/tls/sniff.go @@ -5,7 +5,7 @@ import ( "errors" "strings" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) type SniffHeader struct { diff --git a/common/protocol/tls/sniff_test.go b/common/protocol/tls/sniff_test.go index f5ae1eb43..d334089c7 100644 --- a/common/protocol/tls/sniff_test.go +++ b/common/protocol/tls/sniff_test.go @@ -3,7 +3,7 @@ package tls_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/protocol/tls" + . "github.com/xtls/xray-core/common/protocol/tls" ) func TestTLSHeaders(t *testing.T) { diff --git a/common/protocol/udp/packet.go b/common/protocol/udp/packet.go index 281345591..cc17af986 100644 --- a/common/protocol/udp/packet.go +++ b/common/protocol/udp/packet.go @@ -1,8 +1,8 @@ package udp import ( - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" ) // Packet is a UDP packet together with its source and destination address. diff --git a/common/protocol/user.pb.go b/common/protocol/user.pb.go index 0aee3a612..3fdae9f85 100644 --- a/common/protocol/user.pb.go +++ b/common/protocol/user.pb.go @@ -8,7 +8,7 @@ package protocol import ( proto "github.com/golang/protobuf/proto" - serial "github.com/xtls/xray-core/v1/common/serial" + serial "github.com/xtls/xray-core/common/serial" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -107,13 +107,13 @@ var file_common_protocol_user_proto_rawDesc = []byte{ 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, - 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, + 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/protocol/user.proto b/common/protocol/user.proto index 265430628..44770edf6 100644 --- a/common/protocol/user.proto +++ b/common/protocol/user.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.protocol; option csharp_namespace = "Xray.Common.Protocol"; -option go_package = "github.com/xtls/xray-core/v1/common/protocol"; +option go_package = "github.com/xtls/xray-core/common/protocol"; option java_package = "com.xray.common.protocol"; option java_multiple_files = true; diff --git a/common/retry/errors.generated.go b/common/retry/errors.generated.go index 68df9f0f1..d93432136 100644 --- a/common/retry/errors.generated.go +++ b/common/retry/errors.generated.go @@ -1,6 +1,6 @@ package retry -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/retry/retry.go b/common/retry/retry.go index 17a9a0541..594e10e95 100644 --- a/common/retry/retry.go +++ b/common/retry/retry.go @@ -1,6 +1,6 @@ -package retry // import "github.com/xtls/xray-core/v1/common/retry" +package retry // import "github.com/xtls/xray-core/common/retry" -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "time" diff --git a/common/retry/retry_test.go b/common/retry/retry_test.go index 6f701798d..38a388722 100644 --- a/common/retry/retry_test.go +++ b/common/retry/retry_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - . "github.com/xtls/xray-core/v1/common/retry" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + . "github.com/xtls/xray-core/common/retry" ) var ( diff --git a/common/serial/serial_test.go b/common/serial/serial_test.go index e47a53709..d6fb86ce0 100644 --- a/common/serial/serial_test.go +++ b/common/serial/serial_test.go @@ -6,9 +6,9 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/serial" ) func TestUint16Serial(t *testing.T) { diff --git a/common/serial/string_test.go b/common/serial/string_test.go index 6f122b543..f0967158f 100644 --- a/common/serial/string_test.go +++ b/common/serial/string_test.go @@ -6,7 +6,7 @@ import ( "github.com/google/go-cmp/cmp" - . "github.com/xtls/xray-core/v1/common/serial" + . "github.com/xtls/xray-core/common/serial" ) func TestToString(t *testing.T) { diff --git a/common/serial/typed_message.pb.go b/common/serial/typed_message.pb.go index 5b2379117..1894d5bb5 100644 --- a/common/serial/typed_message.pb.go +++ b/common/serial/typed_message.pb.go @@ -93,13 +93,13 @@ var file_common_serial_typed_message_proto_rawDesc = []byte{ 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x42, 0x5b, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x50, 0x01, 0x5a, 0x2a, 0x67, + 0x65, 0x42, 0x58, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, - 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/common/serial/typed_message.proto b/common/serial/typed_message.proto index 25c8d7b72..558de64b9 100644 --- a/common/serial/typed_message.proto +++ b/common/serial/typed_message.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.serial; option csharp_namespace = "Xray.Common.Serial"; -option go_package = "github.com/xtls/xray-core/v1/common/serial"; +option go_package = "github.com/xtls/xray-core/common/serial"; option java_package = "com.xray.common.serial"; option java_multiple_files = true; diff --git a/common/serial/typed_message_test.go b/common/serial/typed_message_test.go index 55c52271f..726a7733d 100644 --- a/common/serial/typed_message_test.go +++ b/common/serial/typed_message_test.go @@ -3,7 +3,7 @@ package serial_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/serial" + . "github.com/xtls/xray-core/common/serial" ) func TestGetInstance(t *testing.T) { diff --git a/common/session/session.go b/common/session/session.go index a0370ddc6..683bf0b6a 100644 --- a/common/session/session.go +++ b/common/session/session.go @@ -1,13 +1,13 @@ // Package session provides functions for sessions of incoming requests. -package session // import "github.com/xtls/xray-core/v1/common/session" +package session // import "github.com/xtls/xray-core/common/session" import ( "context" "math/rand" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" ) // ID of a session. @@ -37,12 +37,14 @@ func ExportIDToError(ctx context.Context) errors.ExportOption { type Inbound struct { // Source address of the inbound connection. Source net.Destination - // Getaway address + // Getaway address. Gateway net.Destination // Tag of the inbound proxy that handles the connection. Tag string // User is the user that authencates for the inbound. May be nil if the protocol allows anounymous traffic. User *protocol.MemoryUser + // Conn is actually internet.Connection. + Conn net.Conn } // Outbound is the metadata of an outbound connection. diff --git a/common/signal/notifier_test.go b/common/signal/notifier_test.go index 5fb72a361..c753e2537 100644 --- a/common/signal/notifier_test.go +++ b/common/signal/notifier_test.go @@ -3,7 +3,7 @@ package signal_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/signal" + . "github.com/xtls/xray-core/common/signal" ) func TestNotifierSignal(t *testing.T) { diff --git a/common/signal/pubsub/pubsub.go b/common/signal/pubsub/pubsub.go index 51636d991..8612bb614 100644 --- a/common/signal/pubsub/pubsub.go +++ b/common/signal/pubsub/pubsub.go @@ -5,9 +5,9 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/common/task" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/common/task" ) type Subscriber struct { diff --git a/common/signal/pubsub/pubsub_test.go b/common/signal/pubsub/pubsub_test.go index 4ec99bc46..b330e8d95 100644 --- a/common/signal/pubsub/pubsub_test.go +++ b/common/signal/pubsub/pubsub_test.go @@ -3,7 +3,7 @@ package pubsub_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/signal/pubsub" + . "github.com/xtls/xray-core/common/signal/pubsub" ) func TestPubsub(t *testing.T) { diff --git a/common/signal/timer.go b/common/signal/timer.go index b08f133f7..a7f59cd95 100644 --- a/common/signal/timer.go +++ b/common/signal/timer.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/task" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/task" ) type ActivityUpdater interface { diff --git a/common/signal/timer_test.go b/common/signal/timer_test.go index 6987db11d..d56eed2b6 100644 --- a/common/signal/timer_test.go +++ b/common/signal/timer_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - . "github.com/xtls/xray-core/v1/common/signal" + . "github.com/xtls/xray-core/common/signal" ) func TestActivityTimer(t *testing.T) { diff --git a/common/strmatcher/benchmark_test.go b/common/strmatcher/benchmark_test.go index db365e50b..3e70ca042 100644 --- a/common/strmatcher/benchmark_test.go +++ b/common/strmatcher/benchmark_test.go @@ -4,8 +4,8 @@ import ( "strconv" "testing" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/strmatcher" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/strmatcher" ) func BenchmarkDomainMatcherGroup(b *testing.B) { diff --git a/common/strmatcher/domain_matcher_test.go b/common/strmatcher/domain_matcher_test.go index b67a6d23c..5a8ca35b2 100644 --- a/common/strmatcher/domain_matcher_test.go +++ b/common/strmatcher/domain_matcher_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - . "github.com/xtls/xray-core/v1/common/strmatcher" + . "github.com/xtls/xray-core/common/strmatcher" ) func TestDomainMatcherGroup(t *testing.T) { diff --git a/common/strmatcher/full_matcher_test.go b/common/strmatcher/full_matcher_test.go index 51990e420..73d60d51f 100644 --- a/common/strmatcher/full_matcher_test.go +++ b/common/strmatcher/full_matcher_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - . "github.com/xtls/xray-core/v1/common/strmatcher" + . "github.com/xtls/xray-core/common/strmatcher" ) func TestFullMatcherGroup(t *testing.T) { diff --git a/common/strmatcher/matchers_test.go b/common/strmatcher/matchers_test.go index f9020153a..d39c522c8 100644 --- a/common/strmatcher/matchers_test.go +++ b/common/strmatcher/matchers_test.go @@ -3,8 +3,8 @@ package strmatcher_test import ( "testing" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/strmatcher" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/strmatcher" ) func TestMatcher(t *testing.T) { diff --git a/common/strmatcher/strmatcher_test.go b/common/strmatcher/strmatcher_test.go index 1d795b8f8..87d6c5b34 100644 --- a/common/strmatcher/strmatcher_test.go +++ b/common/strmatcher/strmatcher_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/strmatcher" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/strmatcher" ) func TestMatcherGroup(t *testing.T) { diff --git a/common/task/common.go b/common/task/common.go index 99bc4dc0b..b43cc870f 100644 --- a/common/task/common.go +++ b/common/task/common.go @@ -1,6 +1,6 @@ package task -import "github.com/xtls/xray-core/v1/common" +import "github.com/xtls/xray-core/common" // Close returns a func() that closes v. func Close(v interface{}) func() error { diff --git a/common/task/periodic_test.go b/common/task/periodic_test.go index d6a0c6605..9cad3017f 100644 --- a/common/task/periodic_test.go +++ b/common/task/periodic_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/task" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/task" ) func TestPeriodicTaskStop(t *testing.T) { diff --git a/common/task/task.go b/common/task/task.go index 2b64babf2..52b0d44b6 100644 --- a/common/task/task.go +++ b/common/task/task.go @@ -3,7 +3,7 @@ package task import ( "context" - "github.com/xtls/xray-core/v1/common/signal/semaphore" + "github.com/xtls/xray-core/common/signal/semaphore" ) // OnSuccess executes g() after f() returns nil. diff --git a/common/task/task_test.go b/common/task/task_test.go index 6ffe4d613..d871e03e8 100644 --- a/common/task/task_test.go +++ b/common/task/task_test.go @@ -9,8 +9,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/task" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/task" ) func TestExecuteParallel(t *testing.T) { diff --git a/common/type_test.go b/common/type_test.go index 46f9e34a3..d074a3919 100644 --- a/common/type_test.go +++ b/common/type_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - . "github.com/xtls/xray-core/v1/common" + . "github.com/xtls/xray-core/common" ) type TConfig struct { diff --git a/common/uuid/uuid.go b/common/uuid/uuid.go index 3adb2260d..32085d493 100644 --- a/common/uuid/uuid.go +++ b/common/uuid/uuid.go @@ -1,12 +1,12 @@ -package uuid // import "github.com/xtls/xray-core/v1/common/uuid" +package uuid // import "github.com/xtls/xray-core/common/uuid" import ( "bytes" "crypto/rand" "encoding/hex" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" ) var ( diff --git a/common/uuid/uuid_test.go b/common/uuid/uuid_test.go index ba551819a..982af41a9 100644 --- a/common/uuid/uuid_test.go +++ b/common/uuid/uuid_test.go @@ -5,8 +5,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/uuid" ) func TestParseBytes(t *testing.T) { diff --git a/core/config.go b/core/config.go index b773eaac5..15572e770 100644 --- a/core/config.go +++ b/core/config.go @@ -8,10 +8,10 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/cmdarg" - "github.com/xtls/xray-core/v1/main/confloader" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/cmdarg" + "github.com/xtls/xray-core/main/confloader" ) // ConfigFormat is a configurable format of Xray config file. diff --git a/core/config.pb.go b/core/config.pb.go index 8b36d696a..de3d26a27 100644 --- a/core/config.pb.go +++ b/core/config.pb.go @@ -8,8 +8,8 @@ package core import ( proto "github.com/golang/protobuf/proto" - serial "github.com/xtls/xray-core/v1/common/serial" - transport "github.com/xtls/xray-core/v1/transport" + serial "github.com/xtls/xray-core/common/serial" + transport "github.com/xtls/xray-core/transport" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -331,11 +331,11 @@ var file_core_config_proto_rawDesc = []byte{ 0x69, 0x6e, 0x67, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x40, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x50, 0x01, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x3d, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0xaa, 0x02, 0x09, 0x58, - 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0xaa, 0x02, 0x09, 0x58, 0x72, 0x61, 0x79, + 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/core/config.proto b/core/config.proto index 3299c6708..65c2b0a13 100644 --- a/core/config.proto +++ b/core/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.core; option csharp_namespace = "Xray.Core"; -option go_package = "github.com/xtls/xray-core/v1/core"; +option go_package = "github.com/xtls/xray-core/core"; option java_package = "com.xray.core"; option java_multiple_files = true; diff --git a/core/context_test.go b/core/context_test.go index 508d15a39..a16f6120d 100644 --- a/core/context_test.go +++ b/core/context_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - . "github.com/xtls/xray-core/v1/core" + . "github.com/xtls/xray-core/core" ) func TestContextPanic(t *testing.T) { diff --git a/core/core.go b/core/core.go index 5c7846503..17abd43db 100644 --- a/core/core.go +++ b/core/core.go @@ -9,16 +9,16 @@ // connections. package core -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "runtime" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common/serial" ) var ( - version = "1.0.0" + version = "1.1.0" build = "Custom" codename = "Xray, Penetrates Everything." intro = "A unified platform for anti-censorship." diff --git a/core/errors.generated.go b/core/errors.generated.go index 672b26845..47636b9c7 100644 --- a/core/errors.generated.go +++ b/core/errors.generated.go @@ -1,6 +1,6 @@ package core -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/core/functions.go b/core/functions.go index 55ba5060c..fbc8ca57b 100644 --- a/core/functions.go +++ b/core/functions.go @@ -6,10 +6,10 @@ import ( "bytes" "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet/udp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet/udp" ) // CreateObject creates a new object based on the given Xray instance and config. The Xray instance may be nil. diff --git a/core/functions_test.go b/core/functions_test.go index aebc231fa..2439579ee 100644 --- a/core/functions_test.go +++ b/core/functions_test.go @@ -10,15 +10,15 @@ import ( "github.com/golang/protobuf/proto" "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" + "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" ) func xor(b []byte) []byte { diff --git a/core/mocks.go b/core/mocks.go index 025e22fd9..ef43d5e5a 100644 --- a/core/mocks.go +++ b/core/mocks.go @@ -1,8 +1,8 @@ package core //go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/io.go -mock_names Reader=Reader,Writer=Writer io Reader,Writer -//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/log.go -mock_names Handler=LogHandler github.com/xtls/xray-core/v1/common/log Handler -//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/mux.go -mock_names ClientWorkerFactory=MuxClientWorkerFactory github.com/xtls/xray-core/v1/common/mux ClientWorkerFactory -//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/dns.go -mock_names Client=DNSClient github.com/xtls/xray-core/v1/features/dns Client -//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/outbound.go -mock_names Manager=OutboundManager,HandlerSelector=OutboundHandlerSelector github.com/xtls/xray-core/v1/features/outbound Manager,HandlerSelector -//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/proxy.go -mock_names Inbound=ProxyInbound,Outbound=ProxyOutbound github.com/xtls/xray-core/v1/proxy Inbound,Outbound +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/log.go -mock_names Handler=LogHandler github.com/xtls/xray-core/common/log Handler +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/mux.go -mock_names ClientWorkerFactory=MuxClientWorkerFactory github.com/xtls/xray-core/common/mux ClientWorkerFactory +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/dns.go -mock_names Client=DNSClient github.com/xtls/xray-core/features/dns Client +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/outbound.go -mock_names Manager=OutboundManager,HandlerSelector=OutboundHandlerSelector github.com/xtls/xray-core/features/outbound Manager,HandlerSelector +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/proxy.go -mock_names Inbound=ProxyInbound,Outbound=ProxyOutbound github.com/xtls/xray-core/proxy Inbound,Outbound diff --git a/core/xray.go b/core/xray.go index a6e8e3090..bb41044bb 100644 --- a/core/xray.go +++ b/core/xray.go @@ -7,16 +7,16 @@ import ( "reflect" "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/features" - "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/dns/localdns" - "github.com/xtls/xray-core/v1/features/inbound" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/features/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/features" + "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/dns/localdns" + "github.com/xtls/xray-core/features/inbound" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/features/stats" ) // Server is an instance of Xray. At any time, there must be at most one Server instance running. diff --git a/core/xray_test.go b/core/xray_test.go index e5f47c1b5..bb831660d 100644 --- a/core/xray_test.go +++ b/core/xray_test.go @@ -4,21 +4,21 @@ import ( "testing" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - . "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/dns/localdns" - _ "github.com/xtls/xray-core/v1/main/distro/all" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + . "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/dns/localdns" + _ "github.com/xtls/xray-core/main/distro/all" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" ) func TestXrayDependency(t *testing.T) { diff --git a/features/dns/client.go b/features/dns/client.go index e6bdb645a..5591a81d3 100644 --- a/features/dns/client.go +++ b/features/dns/client.go @@ -1,10 +1,10 @@ package dns import ( - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/features" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/features" ) // Client is a Xray feature for querying DNS information. diff --git a/features/dns/localdns/client.go b/features/dns/localdns/client.go index 2cfe255df..c6a9297be 100644 --- a/features/dns/localdns/client.go +++ b/features/dns/localdns/client.go @@ -1,8 +1,8 @@ package localdns import ( - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features/dns" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features/dns" ) // Client is an implementation of dns.Client, which queries localhost for DNS. diff --git a/features/errors.generated.go b/features/errors.generated.go index 13fa0672c..ee8a5182f 100644 --- a/features/errors.generated.go +++ b/features/errors.generated.go @@ -1,6 +1,6 @@ package features -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/features/feature.go b/features/feature.go index efae323ae..1288a86b0 100644 --- a/features/feature.go +++ b/features/feature.go @@ -1,8 +1,8 @@ package features -import "github.com/xtls/xray-core/v1/common" +import "github.com/xtls/xray-core/common" -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen // Feature is the interface for Xray features. All features must implement this interface. // All existing features have an implementation in app directory. These features can be replaced by third-party ones. diff --git a/features/inbound/inbound.go b/features/inbound/inbound.go index ac57b9ea6..fd3a3db56 100644 --- a/features/inbound/inbound.go +++ b/features/inbound/inbound.go @@ -3,9 +3,9 @@ package inbound import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features" ) // Handler is the interface for handlers that process inbound connections. diff --git a/features/outbound/outbound.go b/features/outbound/outbound.go index b25c4427c..ed875439d 100644 --- a/features/outbound/outbound.go +++ b/features/outbound/outbound.go @@ -3,9 +3,9 @@ package outbound import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features" - "github.com/xtls/xray-core/v1/transport" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features" + "github.com/xtls/xray-core/transport" ) // Handler is the interface for handlers that process outbound connections. diff --git a/features/policy/policy.go b/features/policy/policy.go index b10708ce5..c3d48e6ac 100644 --- a/features/policy/policy.go +++ b/features/policy/policy.go @@ -5,8 +5,8 @@ import ( "runtime" "time" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/features" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/features" ) // Timeout contains limits for connection timeout. diff --git a/features/routing/context.go b/features/routing/context.go index 667678c41..f5a732a40 100644 --- a/features/routing/context.go +++ b/features/routing/context.go @@ -1,7 +1,7 @@ package routing import ( - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) // Context is a feature to store connection information for routing. diff --git a/features/routing/dispatcher.go b/features/routing/dispatcher.go index e953bacef..cfc3111ab 100644 --- a/features/routing/dispatcher.go +++ b/features/routing/dispatcher.go @@ -3,9 +3,9 @@ package routing import ( "context" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features" - "github.com/xtls/xray-core/v1/transport" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features" + "github.com/xtls/xray-core/transport" ) // Dispatcher is a feature that dispatches inbound requests to outbound handlers based on rules. diff --git a/features/routing/dns/context.go b/features/routing/dns/context.go index e3d78ddfe..8c8c93325 100644 --- a/features/routing/dns/context.go +++ b/features/routing/dns/context.go @@ -1,11 +1,11 @@ package dns -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/routing" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/routing" ) // ResolvableContext is an implementation of routing.Context, with domain resolving capability. diff --git a/features/routing/dns/errors.generated.go b/features/routing/dns/errors.generated.go index ce4c0605e..d7375a9b9 100644 --- a/features/routing/dns/errors.generated.go +++ b/features/routing/dns/errors.generated.go @@ -1,6 +1,6 @@ package dns -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/features/routing/router.go b/features/routing/router.go index d81a0b30e..3d6f150a2 100644 --- a/features/routing/router.go +++ b/features/routing/router.go @@ -1,8 +1,8 @@ package routing import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features" ) // Router is a feature to choose an outbound tag for the given request. diff --git a/features/routing/session/context.go b/features/routing/session/context.go index c81cea506..0b37ebfa9 100644 --- a/features/routing/session/context.go +++ b/features/routing/session/context.go @@ -3,9 +3,9 @@ package session import ( "context" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/features/routing" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/features/routing" ) // Context is an implementation of routing.Context, which is a wrapper of context.context with session info. diff --git a/features/stats/errors.generated.go b/features/stats/errors.generated.go index d0bc052ad..c64386f32 100644 --- a/features/stats/errors.generated.go +++ b/features/stats/errors.generated.go @@ -1,6 +1,6 @@ package stats -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/features/stats/stats.go b/features/stats/stats.go index b8a4906b1..585a62988 100644 --- a/features/stats/stats.go +++ b/features/stats/stats.go @@ -1,12 +1,12 @@ package stats -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features" ) // Counter is the interface for stats counters. diff --git a/go.mod b/go.mod index b2fe207c8..1af28b471 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/xtls/xray-core/v1 +module github.com/xtls/xray-core go 1.15 @@ -6,7 +6,7 @@ require ( github.com/dgryski/go-metro v0.0.0-20200812162917-85c65e2d0165 // indirect github.com/golang/mock v1.4.4 github.com/golang/protobuf v1.4.3 - github.com/google/go-cmp v0.5.3 + github.com/google/go-cmp v0.5.4 github.com/gorilla/websocket v1.4.2 github.com/lucas-clemente/quic-go v0.19.2 github.com/miekg/dns v1.1.35 @@ -15,10 +15,10 @@ require ( github.com/stretchr/testify v1.6.1 github.com/xtls/go v0.0.0-20201118062508-3632bf3b7499 go.starlark.net v0.0.0-20201118183435-e55f603d8c79 - golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 - golang.org/x/net v0.0.0-20201110031124-69a78807bb2b + golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392 + golang.org/x/net v0.0.0-20201201195509-5d6afe98e0b7 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 - golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 + golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 google.golang.org/grpc v1.33.2 google.golang.org/protobuf v1.25.0 h12.io/socks v1.0.1 diff --git a/go.sum b/go.sum index 720d59106..bf7150bb4 100644 --- a/go.sum +++ b/go.sum @@ -64,7 +64,7 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -168,8 +168,8 @@ golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 h1:phUcVbl53swtrUN8kQEXFhUxPlIlWyBfKmidCu7P95o= -golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392 h1:xYJJ3S178yv++9zXV/hnr29plCAGO9vAFG9dorqaFQc= +golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -190,8 +190,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201201195509-5d6afe98e0b7 h1:3uJsdck53FDIpWwLeAXlia9p4C8j0BO2xZrqzKpL0D8= +golang.org/x/net v0.0.0-20201201195509-5d6afe98e0b7/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -221,8 +221,8 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 h1:kzM6+9dur93BcC2kVlYl34cHU+TYZLanmpSJHVMmL64= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/infra/conf/api.go b/infra/conf/api.go index 1305ce4cc..02bc77dc2 100644 --- a/infra/conf/api.go +++ b/infra/conf/api.go @@ -3,11 +3,11 @@ package conf import ( "strings" - "github.com/xtls/xray-core/v1/app/commander" - loggerservice "github.com/xtls/xray-core/v1/app/log/command" - handlerservice "github.com/xtls/xray-core/v1/app/proxyman/command" - statsservice "github.com/xtls/xray-core/v1/app/stats/command" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/app/commander" + loggerservice "github.com/xtls/xray-core/app/log/command" + handlerservice "github.com/xtls/xray-core/app/proxyman/command" + statsservice "github.com/xtls/xray-core/app/stats/command" + "github.com/xtls/xray-core/common/serial" ) type APIConfig struct { diff --git a/infra/conf/blackhole.go b/infra/conf/blackhole.go index 090507203..6c4f692c2 100644 --- a/infra/conf/blackhole.go +++ b/infra/conf/blackhole.go @@ -5,8 +5,8 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/blackhole" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/blackhole" ) type NoneResponse struct{} diff --git a/infra/conf/blackhole_test.go b/infra/conf/blackhole_test.go index c5e552533..2b0b92950 100644 --- a/infra/conf/blackhole_test.go +++ b/infra/conf/blackhole_test.go @@ -3,9 +3,9 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/serial" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/blackhole" + "github.com/xtls/xray-core/common/serial" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/blackhole" ) func TestHTTPResponseJSON(t *testing.T) { diff --git a/infra/conf/common.go b/infra/conf/common.go index a2674c61e..0de30728f 100644 --- a/infra/conf/common.go +++ b/infra/conf/common.go @@ -5,8 +5,8 @@ import ( "os" "strings" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" ) type StringList []string diff --git a/infra/conf/common_test.go b/infra/conf/common_test.go index 325a1713b..39e4cbeac 100644 --- a/infra/conf/common_test.go +++ b/infra/conf/common_test.go @@ -8,10 +8,10 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - . "github.com/xtls/xray-core/v1/infra/conf" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + . "github.com/xtls/xray-core/infra/conf" ) func TestStringListUnmarshalError(t *testing.T) { diff --git a/infra/conf/conf.go b/infra/conf/conf.go index d31fec57b..9bd3f6674 100644 --- a/infra/conf/conf.go +++ b/infra/conf/conf.go @@ -1,3 +1,3 @@ package conf -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/infra/conf/dns.go b/infra/conf/dns.go index 5a2e886c7..7e7bc0dfc 100644 --- a/infra/conf/dns.go +++ b/infra/conf/dns.go @@ -5,9 +5,9 @@ import ( "sort" "strings" - "github.com/xtls/xray-core/v1/app/dns" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/app/dns" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common/net" ) type NameServerConfig struct { diff --git a/infra/conf/dns_proxy.go b/infra/conf/dns_proxy.go index 6b53317f0..922d32baf 100644 --- a/infra/conf/dns_proxy.go +++ b/infra/conf/dns_proxy.go @@ -2,8 +2,8 @@ package conf import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/proxy/dns" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/proxy/dns" ) type DNSOutboundConfig struct { diff --git a/infra/conf/dns_proxy_test.go b/infra/conf/dns_proxy_test.go index 04699a912..805ac323a 100644 --- a/infra/conf/dns_proxy_test.go +++ b/infra/conf/dns_proxy_test.go @@ -3,9 +3,9 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/dns" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/dns" ) func TestDnsProxyConfig(t *testing.T) { diff --git a/infra/conf/dns_test.go b/infra/conf/dns_test.go index bb5f5c739..680a1f4a9 100644 --- a/infra/conf/dns_test.go +++ b/infra/conf/dns_test.go @@ -7,13 +7,13 @@ import ( "testing" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/app/dns" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/platform/filesystem" - . "github.com/xtls/xray-core/v1/infra/conf" + "github.com/xtls/xray-core/app/dns" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/platform/filesystem" + . "github.com/xtls/xray-core/infra/conf" ) func init() { diff --git a/infra/conf/dokodemo.go b/infra/conf/dokodemo.go index 5a9a36656..03a21d711 100644 --- a/infra/conf/dokodemo.go +++ b/infra/conf/dokodemo.go @@ -2,7 +2,7 @@ package conf import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/dokodemo" ) type DokodemoConfig struct { diff --git a/infra/conf/dokodemo_test.go b/infra/conf/dokodemo_test.go index 8e3b5632f..6432eb42c 100644 --- a/infra/conf/dokodemo_test.go +++ b/infra/conf/dokodemo_test.go @@ -3,9 +3,9 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/dokodemo" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/dokodemo" ) func TestDokodemoConfig(t *testing.T) { diff --git a/infra/conf/errors.generated.go b/infra/conf/errors.generated.go index 47ff06bfc..a80cc1405 100644 --- a/infra/conf/errors.generated.go +++ b/infra/conf/errors.generated.go @@ -1,6 +1,6 @@ package conf -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/infra/conf/freedom.go b/infra/conf/freedom.go index 15a377c18..29e778d25 100644 --- a/infra/conf/freedom.go +++ b/infra/conf/freedom.go @@ -5,9 +5,9 @@ import ( "strings" "github.com/golang/protobuf/proto" - v2net "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/proxy/freedom" + v2net "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/proxy/freedom" ) type FreedomConfig struct { diff --git a/infra/conf/freedom_test.go b/infra/conf/freedom_test.go index ed501eb62..0d0615587 100644 --- a/infra/conf/freedom_test.go +++ b/infra/conf/freedom_test.go @@ -3,10 +3,10 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/freedom" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/freedom" ) func TestFreedomConfig(t *testing.T) { diff --git a/infra/conf/general_test.go b/infra/conf/general_test.go index d537e6153..1de1109c9 100644 --- a/infra/conf/general_test.go +++ b/infra/conf/general_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/infra/conf" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/infra/conf" ) func loadJSON(creator func() Buildable) func(string) (proto.Message, error) { diff --git a/infra/conf/http.go b/infra/conf/http.go index ad47d6e32..e6969582b 100644 --- a/infra/conf/http.go +++ b/infra/conf/http.go @@ -4,9 +4,9 @@ import ( "encoding/json" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/http" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/http" ) type HTTPAccount struct { diff --git a/infra/conf/http_test.go b/infra/conf/http_test.go index fd7d9559b..110cac6b2 100644 --- a/infra/conf/http_test.go +++ b/infra/conf/http_test.go @@ -3,8 +3,8 @@ package conf_test import ( "testing" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/http" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/http" ) func TestHTTPServerConfig(t *testing.T) { diff --git a/infra/conf/json/reader.go b/infra/conf/json/reader.go index faa01baa1..5a675557f 100644 --- a/infra/conf/json/reader.go +++ b/infra/conf/json/reader.go @@ -3,7 +3,7 @@ package json import ( "io" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) // State is the internal state of parser. diff --git a/infra/conf/json/reader_test.go b/infra/conf/json/reader_test.go index 05890a559..6999c2453 100644 --- a/infra/conf/json/reader_test.go +++ b/infra/conf/json/reader_test.go @@ -7,8 +7,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/infra/conf/json" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/infra/conf/json" ) func TestReader(t *testing.T) { diff --git a/infra/conf/log.go b/infra/conf/log.go index 00a02ba81..932a9b253 100644 --- a/infra/conf/log.go +++ b/infra/conf/log.go @@ -3,8 +3,8 @@ package conf import ( "strings" - "github.com/xtls/xray-core/v1/app/log" - clog "github.com/xtls/xray-core/v1/common/log" + "github.com/xtls/xray-core/app/log" + clog "github.com/xtls/xray-core/common/log" ) func DefaultLogConfig() *log.Config { diff --git a/infra/conf/mtproto.go b/infra/conf/mtproto.go index 07229b5ce..a9bc8eec8 100644 --- a/infra/conf/mtproto.go +++ b/infra/conf/mtproto.go @@ -6,9 +6,9 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/mtproto" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/mtproto" ) type MTProtoAccount struct { diff --git a/infra/conf/mtproto_test.go b/infra/conf/mtproto_test.go index c7b1d3ae2..f44cb19a6 100644 --- a/infra/conf/mtproto_test.go +++ b/infra/conf/mtproto_test.go @@ -3,10 +3,10 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/mtproto" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/mtproto" ) func TestMTProtoServerConfig(t *testing.T) { diff --git a/infra/conf/policy.go b/infra/conf/policy.go index 704cc085f..5fbf01e67 100644 --- a/infra/conf/policy.go +++ b/infra/conf/policy.go @@ -1,7 +1,7 @@ package conf import ( - "github.com/xtls/xray-core/v1/app/policy" + "github.com/xtls/xray-core/app/policy" ) type Policy struct { diff --git a/infra/conf/policy_test.go b/infra/conf/policy_test.go index ca2d31116..c880f463f 100644 --- a/infra/conf/policy_test.go +++ b/infra/conf/policy_test.go @@ -3,8 +3,8 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/infra/conf" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/infra/conf" ) func TestBufferSize(t *testing.T) { diff --git a/infra/conf/reverse.go b/infra/conf/reverse.go index 4fb78e1d6..1b42a63a0 100644 --- a/infra/conf/reverse.go +++ b/infra/conf/reverse.go @@ -2,7 +2,7 @@ package conf import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/app/reverse" + "github.com/xtls/xray-core/app/reverse" ) type BridgeConfig struct { diff --git a/infra/conf/reverse_test.go b/infra/conf/reverse_test.go index 2eb739e9f..15da2b1a2 100644 --- a/infra/conf/reverse_test.go +++ b/infra/conf/reverse_test.go @@ -3,8 +3,8 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/app/reverse" - "github.com/xtls/xray-core/v1/infra/conf" + "github.com/xtls/xray-core/app/reverse" + "github.com/xtls/xray-core/infra/conf" ) func TestReverseConfig(t *testing.T) { diff --git a/infra/conf/router.go b/infra/conf/router.go index 156d81a42..236277d94 100644 --- a/infra/conf/router.go +++ b/infra/conf/router.go @@ -7,9 +7,9 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform/filesystem" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform/filesystem" ) type RouterRulesConfig struct { diff --git a/infra/conf/router_test.go b/infra/conf/router_test.go index 3500be879..bb4fdc7d4 100644 --- a/infra/conf/router_test.go +++ b/infra/conf/router_test.go @@ -6,9 +6,9 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/infra/conf" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/infra/conf" ) func TestRouterConfig(t *testing.T) { diff --git a/infra/conf/serial/errors.generated.go b/infra/conf/serial/errors.generated.go index a75a8a303..e78fc61ea 100644 --- a/infra/conf/serial/errors.generated.go +++ b/infra/conf/serial/errors.generated.go @@ -1,6 +1,6 @@ package serial -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/infra/conf/serial/loader.go b/infra/conf/serial/loader.go index f56101b1c..03075d960 100644 --- a/infra/conf/serial/loader.go +++ b/infra/conf/serial/loader.go @@ -5,10 +5,10 @@ import ( "encoding/json" "io" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/infra/conf" - json_reader "github.com/xtls/xray-core/v1/infra/conf/json" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/infra/conf" + json_reader "github.com/xtls/xray-core/infra/conf/json" ) type offset struct { diff --git a/infra/conf/serial/loader_test.go b/infra/conf/serial/loader_test.go index 0847989c2..e6a745b40 100644 --- a/infra/conf/serial/loader_test.go +++ b/infra/conf/serial/loader_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/xtls/xray-core/v1/infra/conf/serial" + "github.com/xtls/xray-core/infra/conf/serial" ) func TestLoaderError(t *testing.T) { diff --git a/infra/conf/serial/serial.go b/infra/conf/serial/serial.go index 81ccf7710..3e6711ff4 100644 --- a/infra/conf/serial/serial.go +++ b/infra/conf/serial/serial.go @@ -1,3 +1,3 @@ package serial -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/infra/conf/shadowsocks.go b/infra/conf/shadowsocks.go index 3b032b723..9ccd37b4f 100644 --- a/infra/conf/shadowsocks.go +++ b/infra/conf/shadowsocks.go @@ -5,9 +5,9 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/shadowsocks" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/shadowsocks" ) func cipherFromString(c string) shadowsocks.CipherType { diff --git a/infra/conf/shadowsocks_test.go b/infra/conf/shadowsocks_test.go index 65114295a..2455551a4 100644 --- a/infra/conf/shadowsocks_test.go +++ b/infra/conf/shadowsocks_test.go @@ -3,11 +3,11 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/shadowsocks" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/shadowsocks" ) func TestShadowsocksServerConfigParsing(t *testing.T) { diff --git a/infra/conf/socks.go b/infra/conf/socks.go index 4214551da..05dad7bc1 100644 --- a/infra/conf/socks.go +++ b/infra/conf/socks.go @@ -4,9 +4,9 @@ import ( "encoding/json" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/socks" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/socks" ) type SocksAccount struct { diff --git a/infra/conf/socks_test.go b/infra/conf/socks_test.go index 4ea2aedda..ff1833b86 100644 --- a/infra/conf/socks_test.go +++ b/infra/conf/socks_test.go @@ -3,11 +3,11 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/socks" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/socks" ) func TestSocksInboundConfig(t *testing.T) { diff --git a/infra/conf/transport.go b/infra/conf/transport.go index a8899431d..69d748322 100644 --- a/infra/conf/transport.go +++ b/infra/conf/transport.go @@ -1,9 +1,9 @@ package conf import ( - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) type TransportConfig struct { diff --git a/infra/conf/transport_authenticators.go b/infra/conf/transport_authenticators.go index a19dd930f..c9e42605b 100644 --- a/infra/conf/transport_authenticators.go +++ b/infra/conf/transport_authenticators.go @@ -5,13 +5,13 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/transport/internet/headers/http" - "github.com/xtls/xray-core/v1/transport/internet/headers/noop" - "github.com/xtls/xray-core/v1/transport/internet/headers/srtp" - "github.com/xtls/xray-core/v1/transport/internet/headers/tls" - "github.com/xtls/xray-core/v1/transport/internet/headers/utp" - "github.com/xtls/xray-core/v1/transport/internet/headers/wechat" - "github.com/xtls/xray-core/v1/transport/internet/headers/wireguard" + "github.com/xtls/xray-core/transport/internet/headers/http" + "github.com/xtls/xray-core/transport/internet/headers/noop" + "github.com/xtls/xray-core/transport/internet/headers/srtp" + "github.com/xtls/xray-core/transport/internet/headers/tls" + "github.com/xtls/xray-core/transport/internet/headers/utp" + "github.com/xtls/xray-core/transport/internet/headers/wechat" + "github.com/xtls/xray-core/transport/internet/headers/wireguard" ) type NoOpAuthenticator struct{} diff --git a/infra/conf/transport_internet.go b/infra/conf/transport_internet.go index 3c3b20534..926a71b6a 100644 --- a/infra/conf/transport_internet.go +++ b/infra/conf/transport_internet.go @@ -5,18 +5,18 @@ import ( "strings" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/platform/filesystem" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/domainsocket" - "github.com/xtls/xray-core/v1/transport/internet/http" - "github.com/xtls/xray-core/v1/transport/internet/kcp" - "github.com/xtls/xray-core/v1/transport/internet/quic" - "github.com/xtls/xray-core/v1/transport/internet/tcp" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/websocket" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common/platform/filesystem" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/domainsocket" + "github.com/xtls/xray-core/transport/internet/http" + "github.com/xtls/xray-core/transport/internet/kcp" + "github.com/xtls/xray-core/transport/internet/quic" + "github.com/xtls/xray-core/transport/internet/tcp" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/websocket" + "github.com/xtls/xray-core/transport/internet/xtls" ) var ( diff --git a/infra/conf/transport_test.go b/infra/conf/transport_test.go index 5ba056073..555515212 100644 --- a/infra/conf/transport_test.go +++ b/infra/conf/transport_test.go @@ -5,18 +5,18 @@ import ( "testing" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/headers/http" - "github.com/xtls/xray-core/v1/transport/internet/headers/noop" - "github.com/xtls/xray-core/v1/transport/internet/headers/tls" - "github.com/xtls/xray-core/v1/transport/internet/kcp" - "github.com/xtls/xray-core/v1/transport/internet/quic" - "github.com/xtls/xray-core/v1/transport/internet/tcp" - "github.com/xtls/xray-core/v1/transport/internet/websocket" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/headers/http" + "github.com/xtls/xray-core/transport/internet/headers/noop" + "github.com/xtls/xray-core/transport/internet/headers/tls" + "github.com/xtls/xray-core/transport/internet/kcp" + "github.com/xtls/xray-core/transport/internet/quic" + "github.com/xtls/xray-core/transport/internet/tcp" + "github.com/xtls/xray-core/transport/internet/websocket" ) func TestSocketConfig(t *testing.T) { diff --git a/infra/conf/trojan.go b/infra/conf/trojan.go index dc36b039b..0412be6c2 100644 --- a/infra/conf/trojan.go +++ b/infra/conf/trojan.go @@ -8,10 +8,10 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/trojan" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/trojan" ) // TrojanServerTarget is configuration of a single trojan server diff --git a/infra/conf/vless.go b/infra/conf/vless.go index c2d5e5ec1..521ad6503 100644 --- a/infra/conf/vless.go +++ b/infra/conf/vless.go @@ -8,12 +8,12 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/vless" - "github.com/xtls/xray-core/v1/proxy/vless/inbound" - "github.com/xtls/xray-core/v1/proxy/vless/outbound" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/vless" + "github.com/xtls/xray-core/proxy/vless/inbound" + "github.com/xtls/xray-core/proxy/vless/outbound" ) type VLessInboundFallback struct { @@ -47,6 +47,8 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) { switch account.Flow { case "", "xtls-rprx-origin", "xtls-rprx-direct": + case "xtls-rprx-splice": + return nil, newError(`VLESS clients: inbound doesn't support "xtls-rprx-splice" in this version, please use "xtls-rprx-direct" instead`) default: return nil, newError(`VLESS clients: "flow" doesn't support "` + account.Flow + `" in this version`) } @@ -167,6 +169,10 @@ func (c *VLessOutboundConfig) Build() (proto.Message, error) { switch account.Flow { case "", "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-direct", "xtls-rprx-direct-udp443": + case "xtls-rprx-splice", "xtls-rprx-splice-udp443": + if runtime.GOOS != "linux" { + return nil, newError(`VLESS users: "` + account.Flow + `" only support linux in this version`) + } default: return nil, newError(`VLESS users: "flow" doesn't support "` + account.Flow + `" in this version`) } diff --git a/infra/conf/vless_test.go b/infra/conf/vless_test.go index cfdde078c..819ee9421 100644 --- a/infra/conf/vless_test.go +++ b/infra/conf/vless_test.go @@ -3,13 +3,13 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/vless" - "github.com/xtls/xray-core/v1/proxy/vless/inbound" - "github.com/xtls/xray-core/v1/proxy/vless/outbound" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/vless" + "github.com/xtls/xray-core/proxy/vless/inbound" + "github.com/xtls/xray-core/proxy/vless/outbound" ) func TestVLessOutbound(t *testing.T) { diff --git a/infra/conf/vmess.go b/infra/conf/vmess.go index b8e0b7d4e..56639f1af 100644 --- a/infra/conf/vmess.go +++ b/infra/conf/vmess.go @@ -6,11 +6,11 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" ) type VMessAccount struct { diff --git a/infra/conf/vmess_test.go b/infra/conf/vmess_test.go index 9ad0db5ed..e6b9d58b0 100644 --- a/infra/conf/vmess_test.go +++ b/infra/conf/vmess_test.go @@ -3,13 +3,13 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" ) func TestVMessOutbound(t *testing.T) { diff --git a/infra/conf/xray.go b/infra/conf/xray.go index 17e20fb8d..34f30afa0 100644 --- a/infra/conf/xray.go +++ b/infra/conf/xray.go @@ -6,12 +6,12 @@ import ( "os" "strings" - "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/app/stats" - "github.com/xtls/xray-core/v1/common/serial" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common/serial" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/transport/internet/xtls" ) var ( diff --git a/infra/conf/xray_test.go b/infra/conf/xray_test.go index 55ba54f24..d4f0ba6b5 100644 --- a/infra/conf/xray_test.go +++ b/infra/conf/xray_test.go @@ -7,26 +7,26 @@ import ( "github.com/golang/protobuf/proto" "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - core "github.com/xtls/xray-core/v1/core" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/blackhole" - dns_proxy "github.com/xtls/xray-core/v1/proxy/dns" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/http" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/websocket" + "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + core "github.com/xtls/xray-core/core" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/blackhole" + dns_proxy "github.com/xtls/xray-core/proxy/dns" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/http" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/websocket" ) func TestXrayConfig(t *testing.T) { diff --git a/infra/vprotogen/main.go b/infra/vprotogen/main.go index 5a286524c..35bd3592a 100644 --- a/infra/vprotogen/main.go +++ b/infra/vprotogen/main.go @@ -8,8 +8,8 @@ import ( "runtime" "strings" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/core" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/core" ) func main() { diff --git a/main/commands/all/api.go b/main/commands/all/api.go deleted file mode 100644 index 20aa3fb24..000000000 --- a/main/commands/all/api.go +++ /dev/null @@ -1,164 +0,0 @@ -package all - -import ( - "context" - "errors" - "fmt" - "strings" - "time" - - "google.golang.org/grpc" - "google.golang.org/protobuf/proto" - - logService "github.com/xtls/xray-core/v1/app/log/command" - statsService "github.com/xtls/xray-core/v1/app/stats/command" - "github.com/xtls/xray-core/v1/main/commands/base" -) - -// cmdAPI calls an API in an Xray process -var cmdAPI = &base.Command{ - UsageLine: "{{.Exec}} api [-server 127.0.0.1:8080] ", - Short: "Call an API in a Xray process", - Long: ` -Call an API in a Xray process, API calls in this command have a timeout to the server of 3 seconds. - -The following methods are currently supported: - - LoggerService.RestartLogger - StatsService.GetStats - StatsService.QueryStats - -Examples: - - {{.Exec}} api --server=127.0.0.1:8080 LoggerService.RestartLogger '' - {{.Exec}} api --server=127.0.0.1:8080 StatsService.QueryStats 'pattern: "" reset: false' - {{.Exec}} api --server=127.0.0.1:8080 StatsService.GetStats 'name: "inbound>>>statin>>>traffic>>>downlink" reset: false' - {{.Exec}} api --server=127.0.0.1:8080 StatsService.GetSysStats '' - `, -} - -func init() { - cmdAPI.Run = executeAPI // break init loop -} - -var ( - apiServerAddrPtr = cmdAPI.Flag.String("server", "127.0.0.1:8080", "") -) - -func executeAPI(cmd *base.Command, args []string) { - unnamedArgs := cmdAPI.Flag.Args() - if len(unnamedArgs) < 2 { - base.Fatalf("service name or request not specified.") - } - - service, method := getServiceMethod(unnamedArgs[0]) - handler, found := serivceHandlerMap[strings.ToLower(service)] - if !found { - base.Fatalf("unknown service: %s", service) - } - - ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) - defer cancel() - - conn, err := grpc.DialContext(ctx, *apiServerAddrPtr, grpc.WithInsecure(), grpc.WithBlock()) - if err != nil { - base.Fatalf("failed to dial %s", *apiServerAddrPtr) - } - defer conn.Close() - - response, err := handler(ctx, conn, method, unnamedArgs[1]) - if err != nil { - base.Fatalf("failed to call service %s", unnamedArgs[0]) - } - - fmt.Println(response) -} - -func getServiceMethod(s string) (string, string) { - ss := strings.Split(s, ".") - service := ss[0] - var method string - if len(ss) > 1 { - method = ss[1] - } - return service, method -} - -type serviceHandler func(ctx context.Context, conn *grpc.ClientConn, method string, request string) (string, error) - -var serivceHandlerMap = map[string]serviceHandler{ - "statsservice": callStatsService, - "loggerservice": callLogService, -} - -func callLogService(ctx context.Context, conn *grpc.ClientConn, method string, request string) (string, error) { - client := logService.NewLoggerServiceClient(conn) - - switch strings.ToLower(method) { - case "restartlogger": - r := &logService.RestartLoggerRequest{} - if err := proto.Unmarshal([]byte(request), r); err != nil { - return "", err - } - resp, err := client.RestartLogger(ctx, r) - if err != nil { - return "", err - } - m, err := proto.Marshal(resp) - if err != nil { - return "", err - } - return string(m), nil - default: - return "", errors.New("Unknown method: " + method) - } -} - -func callStatsService(ctx context.Context, conn *grpc.ClientConn, method string, request string) (string, error) { - client := statsService.NewStatsServiceClient(conn) - - switch strings.ToLower(method) { - case "getstats": - r := &statsService.GetStatsRequest{} - if err := proto.Unmarshal([]byte(request), r); err != nil { - return "", err - } - resp, err := client.GetStats(ctx, r) - if err != nil { - return "", err - } - m, err := proto.Marshal(resp) - if err != nil { - return "", err - } - return string(m), nil - case "querystats": - r := &statsService.QueryStatsRequest{} - if err := proto.Unmarshal([]byte(request), r); err != nil { - return "", err - } - resp, err := client.QueryStats(ctx, r) - if err != nil { - return "", err - } - m, err := proto.Marshal(resp) - if err != nil { - return "", err - } - return string(m), nil - case "getsysstats": - // SysStatsRequest is an empty message - r := &statsService.SysStatsRequest{} - resp, err := client.GetSysStats(ctx, r) - if err != nil { - return "", err - } - m, err := proto.Marshal(resp) - if err != nil { - return "", err - } - return string(m), nil - default: - return "", errors.New("Unknown method: " + method) - } -} diff --git a/main/commands/all/api/api.go b/main/commands/all/api/api.go new file mode 100644 index 000000000..9986329b6 --- /dev/null +++ b/main/commands/all/api/api.go @@ -0,0 +1,23 @@ +package api + +import ( + "github.com/xtls/xray-core/main/commands/base" +) + +// CmdAPI calls an API in an Xray process +var CmdAPI = &base.Command{ + UsageLine: "{{.Exec}} api", + Short: "Call an API in an Xray process", + Long: `{{.Exec}} {{.LongName}} provides tools to manipulate Xray via its API. +`, + Commands: []*base.Command{ + cmdRestartLogger, + cmdGetStats, + cmdQueryStats, + cmdSysStats, + cmdAddInbounds, + cmdAddOutbounds, + cmdRemoveInbounds, + cmdRemoveOutbounds, + }, +} diff --git a/main/commands/all/api/inbounds_add.go b/main/commands/all/api/inbounds_add.go new file mode 100644 index 000000000..30c72a4ad --- /dev/null +++ b/main/commands/all/api/inbounds_add.go @@ -0,0 +1,73 @@ +package api + +import ( + "fmt" + + handlerService "github.com/xtls/xray-core/app/proxyman/command" + "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/infra/conf/serial" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdAddInbounds = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api adi [--server=127.0.0.1:8080] [c2.json]...", + Short: "Add inbounds", + Long: ` +Add inbounds to Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 +Example: + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json c2.json +`, + Run: executeAddInbounds, +} + +func executeAddInbounds(cmd *base.Command, args []string) { + setSharedFlags(cmd) + cmd.Flag.Parse(args) + unnamedArgs := cmd.Flag.Args() + if len(unnamedArgs) == 0 { + fmt.Println("reading from stdin:") + unnamedArgs = []string{"stdin:"} + } + + ins := make([]conf.InboundDetourConfig, 0) + for _, arg := range unnamedArgs { + r, err := loadArg(arg) + if err != nil { + base.Fatalf("failed to load %s: %s", arg, err) + } + conf, err := serial.DecodeJSONConfig(r) + if err != nil { + base.Fatalf("failed to decode %s: %s", arg, err) + } + ins = append(ins, conf.InboundConfigs...) + } + if len(ins) == 0 { + base.Fatalf("no valid inbound found") + } + + conn, ctx, close := dialAPIServer() + defer close() + + client := handlerService.NewHandlerServiceClient(conn) + for _, in := range ins { + fmt.Println("adding:", in.Tag) + i, err := in.Build() + if err != nil { + base.Fatalf("failed to build conf: %s", err) + } + r := &handlerService.AddInboundRequest{ + Inbound: i, + } + resp, err := client.AddInbound(ctx, r) + if err != nil { + base.Fatalf("failed to add inbound: %s", err) + } + showResponese(resp) + } +} diff --git a/main/commands/all/api/inbounds_remove.go b/main/commands/all/api/inbounds_remove.go new file mode 100644 index 000000000..1673943a9 --- /dev/null +++ b/main/commands/all/api/inbounds_remove.go @@ -0,0 +1,74 @@ +package api + +import ( + "fmt" + + handlerService "github.com/xtls/xray-core/app/proxyman/command" + "github.com/xtls/xray-core/infra/conf/serial" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdRemoveInbounds = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api rmi [--server=127.0.0.1:8080] [json_file] [tag]...", + Short: "Remove inbounds", + Long: ` +Remove inbounds from Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 +Example: + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json "tag name" +`, + Run: executeRemoveInbounds, +} + +func executeRemoveInbounds(cmd *base.Command, args []string) { + setSharedFlags(cmd) + cmd.Flag.Parse(args) + unnamedArgs := cmd.Flag.Args() + if len(unnamedArgs) == 0 { + fmt.Println("reading from stdin:") + unnamedArgs = []string{"stdin:"} + } + + tags := make([]string, 0) + for _, arg := range unnamedArgs { + if r, err := loadArg(arg); err == nil { + conf, err := serial.DecodeJSONConfig(r) + if err != nil { + base.Fatalf("failed to decode %s: %s", arg, err) + } + ins := conf.InboundConfigs + for _, i := range ins { + tags = append(tags, i.Tag) + } + } else { + // take request as tag + tags = append(tags, arg) + } + } + + if len(tags) == 0 { + base.Fatalf("no inbound to remove") + } + fmt.Println("removing inbounds:", tags) + + conn, ctx, close := dialAPIServer() + defer close() + + client := handlerService.NewHandlerServiceClient(conn) + for _, tag := range tags { + fmt.Println("removing:", tag) + r := &handlerService.RemoveInboundRequest{ + Tag: tag, + } + resp, err := client.RemoveInbound(ctx, r) + if err != nil { + base.Fatalf("failed to remove inbound: %s", err) + } + showResponese(resp) + } +} diff --git a/main/commands/all/api/logger_restart.go b/main/commands/all/api/logger_restart.go new file mode 100644 index 000000000..259ac9627 --- /dev/null +++ b/main/commands/all/api/logger_restart.go @@ -0,0 +1,37 @@ +package api + +import ( + logService "github.com/xtls/xray-core/app/log/command" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdRestartLogger = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api restartlogger [--server=127.0.0.1:8080]", + Short: "Restart the logger", + Long: ` +Restart the logger of Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 +`, + Run: executeRestartLogger, +} + +func executeRestartLogger(cmd *base.Command, args []string) { + setSharedFlags(cmd) + cmd.Flag.Parse(args) + + conn, ctx, close := dialAPIServer() + defer close() + + client := logService.NewLoggerServiceClient(conn) + r := &logService.RestartLoggerRequest{} + resp, err := client.RestartLogger(ctx, r) + if err != nil { + base.Fatalf("failed to restart logger: %s", err) + } + showResponese(resp) +} diff --git a/main/commands/all/api/outbounds_add.go b/main/commands/all/api/outbounds_add.go new file mode 100644 index 000000000..5d99de4fb --- /dev/null +++ b/main/commands/all/api/outbounds_add.go @@ -0,0 +1,73 @@ +package api + +import ( + "fmt" + + handlerService "github.com/xtls/xray-core/app/proxyman/command" + "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/infra/conf/serial" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdAddOutbounds = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api ado [--server=127.0.0.1:8080] [c2.json]...", + Short: "Add outbounds", + Long: ` +Add outbounds to Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 +Example: + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json c2.json +`, + Run: executeAddOutbounds, +} + +func executeAddOutbounds(cmd *base.Command, args []string) { + setSharedFlags(cmd) + cmd.Flag.Parse(args) + unnamedArgs := cmd.Flag.Args() + if len(unnamedArgs) == 0 { + fmt.Println("Reading from STDIN") + unnamedArgs = []string{"stdin:"} + } + + outs := make([]conf.OutboundDetourConfig, 0) + for _, arg := range unnamedArgs { + r, err := loadArg(arg) + if err != nil { + base.Fatalf("failed to load %s: %s", arg, err) + } + conf, err := serial.DecodeJSONConfig(r) + if err != nil { + base.Fatalf("failed to decode %s: %s", arg, err) + } + outs = append(outs, conf.OutboundConfigs...) + } + if len(outs) == 0 { + base.Fatalf("no valid outbound found") + } + + conn, ctx, close := dialAPIServer() + defer close() + + client := handlerService.NewHandlerServiceClient(conn) + for _, out := range outs { + fmt.Println("adding:", out.Tag) + o, err := out.Build() + if err != nil { + base.Fatalf("failed to build conf: %s", err) + } + r := &handlerService.AddOutboundRequest{ + Outbound: o, + } + resp, err := client.AddOutbound(ctx, r) + if err != nil { + base.Fatalf("failed to add outbound: %s", err) + } + showResponese(resp) + } +} diff --git a/main/commands/all/api/outbounds_remove.go b/main/commands/all/api/outbounds_remove.go new file mode 100644 index 000000000..d9a8a945c --- /dev/null +++ b/main/commands/all/api/outbounds_remove.go @@ -0,0 +1,73 @@ +package api + +import ( + "fmt" + + handlerService "github.com/xtls/xray-core/app/proxyman/command" + "github.com/xtls/xray-core/infra/conf/serial" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdRemoveOutbounds = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api rmo [--server=127.0.0.1:8080] [json_file] [tag]...", + Short: "Remove outbounds", + Long: ` +Remove outbounds from Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 +Example: + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json "tag name" +`, + Run: executeRemoveOutbounds, +} + +func executeRemoveOutbounds(cmd *base.Command, args []string) { + setSharedFlags(cmd) + cmd.Flag.Parse(args) + unnamedArgs := cmd.Flag.Args() + if len(unnamedArgs) == 0 { + fmt.Println("reading from stdin:") + unnamedArgs = []string{"stdin:"} + } + + tags := make([]string, 0) + for _, arg := range unnamedArgs { + if r, err := loadArg(arg); err == nil { + conf, err := serial.DecodeJSONConfig(r) + if err != nil { + base.Fatalf("failed to decode %s: %s", arg, err) + } + outs := conf.OutboundConfigs + for _, o := range outs { + tags = append(tags, o.Tag) + } + } else { + // take request as tag + tags = append(tags, arg) + } + } + + if len(tags) == 0 { + base.Fatalf("no outbound to remove") + } + + conn, ctx, close := dialAPIServer() + defer close() + + client := handlerService.NewHandlerServiceClient(conn) + for _, tag := range tags { + fmt.Println("removing:", tag) + r := &handlerService.RemoveOutboundRequest{ + Tag: tag, + } + resp, err := client.RemoveOutbound(ctx, r) + if err != nil { + base.Fatalf("failed to remove outbound: %s", err) + } + showResponese(resp) + } +} diff --git a/main/commands/all/api/shared.go b/main/commands/all/api/shared.go new file mode 100644 index 000000000..71ae62473 --- /dev/null +++ b/main/commands/all/api/shared.go @@ -0,0 +1,119 @@ +package api + +import ( + "bytes" + "context" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "os" + "strings" + "time" + + "google.golang.org/grpc" + "google.golang.org/protobuf/proto" + + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/main/commands/base" +) + +type serviceHandler func(ctx context.Context, conn *grpc.ClientConn, cmd *base.Command, args []string) string + +var ( + apiServerAddrPtr string + apiTimeout int +) + +func setSharedFlags(cmd *base.Command) { + cmd.Flag.StringVar(&apiServerAddrPtr, "s", "127.0.0.1:8080", "") + cmd.Flag.StringVar(&apiServerAddrPtr, "server", "127.0.0.1:8080", "") + cmd.Flag.IntVar(&apiTimeout, "t", 3, "") + cmd.Flag.IntVar(&apiTimeout, "timeout", 3, "") +} + +func dialAPIServer() (conn *grpc.ClientConn, ctx context.Context, close func()) { + ctx, cancel := context.WithTimeout(context.Background(), time.Duration(apiTimeout)*time.Second) + conn, err := grpc.DialContext(ctx, apiServerAddrPtr, grpc.WithInsecure(), grpc.WithBlock()) + if err != nil { + base.Fatalf("failed to dial %s", apiServerAddrPtr) + } + close = func() { + cancel() + conn.Close() + } + return +} + +// loadArg loads one arg, maybe an remote url, or local file path +func loadArg(arg string) (out io.Reader, err error) { + var data []byte + switch { + case strings.HasPrefix(arg, "http://"), strings.HasPrefix(arg, "https://"): + data, err = fetchHTTPContent(arg) + + case arg == "stdin:": + data, err = ioutil.ReadAll(os.Stdin) + + default: + data, err = ioutil.ReadFile(arg) + } + + if err != nil { + return + } + out = bytes.NewBuffer(data) + return +} + +// fetchHTTPContent dials https for remote content +func fetchHTTPContent(target string) ([]byte, error) { + parsedTarget, err := url.Parse(target) + if err != nil { + return nil, err + } + + if s := strings.ToLower(parsedTarget.Scheme); s != "http" && s != "https" { + return nil, fmt.Errorf("invalid scheme: %s", parsedTarget.Scheme) + } + + client := &http.Client{ + Timeout: 30 * time.Second, + } + resp, err := client.Do(&http.Request{ + Method: "GET", + URL: parsedTarget, + Close: true, + }) + if err != nil { + return nil, fmt.Errorf("failed to dial to %s", target) + } + defer resp.Body.Close() + + if resp.StatusCode != 200 { + return nil, fmt.Errorf("unexpected HTTP status code: %d", resp.StatusCode) + } + + content, err := buf.ReadAllToBytes(resp.Body) + if err != nil { + return nil, fmt.Errorf("failed to read HTTP response") + } + + return content, nil +} + +func showResponese(m proto.Message) { + msg := "" + bs, err := proto.Marshal(m) + if err != nil { + msg = err.Error() + } else { + msg = string(bs) + msg = strings.TrimSpace(msg) + } + if msg == "" { + return + } + fmt.Println(msg) +} diff --git a/main/commands/all/api/stats_get.go b/main/commands/all/api/stats_get.go new file mode 100644 index 000000000..7e87cb98b --- /dev/null +++ b/main/commands/all/api/stats_get.go @@ -0,0 +1,48 @@ +package api + +import ( + statsService "github.com/xtls/xray-core/app/stats/command" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdGetStats = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api stats [--server=127.0.0.1:8080] [-name '']", + Short: "Get statistics", + Long: ` +Get statistics from Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 + -name + Name of the stat counter. + -reset + Reset the counter to fetching its value. +Example: + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -name "inbound>>>statin>>>traffic>>>downlink" +`, + Run: executeGetStats, +} + +func executeGetStats(cmd *base.Command, args []string) { + setSharedFlags(cmd) + statName := cmd.Flag.String("name", "", "") + reset := cmd.Flag.Bool("reset", false, "") + cmd.Flag.Parse(args) + + conn, ctx, close := dialAPIServer() + defer close() + + client := statsService.NewStatsServiceClient(conn) + r := &statsService.GetStatsRequest{ + Name: *statName, + Reset_: *reset, + } + resp, err := client.GetStats(ctx, r) + if err != nil { + base.Fatalf("failed to get stats: %s", err) + } + showResponese(resp) +} diff --git a/main/commands/all/api/stats_query.go b/main/commands/all/api/stats_query.go new file mode 100644 index 000000000..725b506b2 --- /dev/null +++ b/main/commands/all/api/stats_query.go @@ -0,0 +1,48 @@ +package api + +import ( + statsService "github.com/xtls/xray-core/app/stats/command" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdQueryStats = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api statsquery [--server=127.0.0.1:8080] [-pattern '']", + Short: "Query statistics", + Long: ` +Query statistics from Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 + -pattern + Pattern of the query. + -reset + Reset the counter to fetching its value. +Example: + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -pattern "counter_" +`, + Run: executeQueryStats, +} + +func executeQueryStats(cmd *base.Command, args []string) { + setSharedFlags(cmd) + pattern := cmd.Flag.String("pattern", "", "") + reset := cmd.Flag.Bool("reset", false, "") + cmd.Flag.Parse(args) + + conn, ctx, close := dialAPIServer() + defer close() + + client := statsService.NewStatsServiceClient(conn) + r := &statsService.QueryStatsRequest{ + Pattern: *pattern, + Reset_: *reset, + } + resp, err := client.QueryStats(ctx, r) + if err != nil { + base.Fatalf("failed to query stats: %s", err) + } + showResponese(resp) +} diff --git a/main/commands/all/api/stats_sys.go b/main/commands/all/api/stats_sys.go new file mode 100644 index 000000000..5f32d05b9 --- /dev/null +++ b/main/commands/all/api/stats_sys.go @@ -0,0 +1,37 @@ +package api + +import ( + statsService "github.com/xtls/xray-core/app/stats/command" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdSysStats = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api statssys [--server=127.0.0.1:8080]", + Short: "Get system statistics", + Long: ` +Get system statistics from Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 +`, + Run: executeSysStats, +} + +func executeSysStats(cmd *base.Command, args []string) { + setSharedFlags(cmd) + cmd.Flag.Parse(args) + + conn, ctx, close := dialAPIServer() + defer close() + + client := statsService.NewStatsServiceClient(conn) + r := &statsService.SysStatsRequest{} + resp, err := client.GetSysStats(ctx, r) + if err != nil { + base.Fatalf("failed to get sys stats: %s", err) + } + showResponese(resp) +} diff --git a/main/commands/all/commands.go b/main/commands/all/commands.go index fe08c2f80..a4945c8e9 100644 --- a/main/commands/all/commands.go +++ b/main/commands/all/commands.go @@ -1,15 +1,19 @@ package all -import "github.com/xtls/xray-core/v1/main/commands/base" +import ( + "github.com/xtls/xray-core/main/commands/all/api" + "github.com/xtls/xray-core/main/commands/all/tls" + "github.com/xtls/xray-core/main/commands/base" +) -// go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +// go:generate go run github.com/xtls/xray-core/common/errors/errorgen func init() { base.RootCommand.Commands = append( base.RootCommand.Commands, - cmdAPI, - cmdConvert, - cmdTLS, + api.CmdAPI, + //cmdConvert, + tls.CmdTLS, cmdUUID, ) } diff --git a/main/commands/all/convert.go b/main/commands/all/convert.go index d98813b19..c580fc500 100644 --- a/main/commands/all/convert.go +++ b/main/commands/all/convert.go @@ -11,11 +11,11 @@ import ( "strings" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/infra/conf/serial" - "github.com/xtls/xray-core/v1/main/commands/base" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/infra/conf/serial" + "github.com/xtls/xray-core/main/commands/base" "google.golang.org/protobuf/proto" ) diff --git a/main/commands/all/errors.generated.go b/main/commands/all/errors.generated.go index 254912c13..ff138a8a2 100644 --- a/main/commands/all/errors.generated.go +++ b/main/commands/all/errors.generated.go @@ -1,6 +1,6 @@ package all -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/main/commands/all/tls.go b/main/commands/all/tls.go deleted file mode 100644 index 2274d5355..000000000 --- a/main/commands/all/tls.go +++ /dev/null @@ -1,18 +0,0 @@ -package all - -import ( - "github.com/xtls/xray-core/v1/main/commands/all/tlscmd" - "github.com/xtls/xray-core/v1/main/commands/base" -) - -var cmdTLS = &base.Command{ - UsageLine: "{{.Exec}} tls", - Short: "TLS tools", - Long: `{{.Exec}} tls provides tools for TLS. - `, - - Commands: []*base.Command{ - tlscmd.CmdCert, - tlscmd.CmdPing, - }, -} diff --git a/main/commands/all/tlscmd/cert.go b/main/commands/all/tls/cert.go similarity index 67% rename from main/commands/all/tlscmd/cert.go rename to main/commands/all/tls/cert.go index d43721093..03dd764fc 100644 --- a/main/commands/all/tlscmd/cert.go +++ b/main/commands/all/tls/cert.go @@ -1,4 +1,4 @@ -package tlscmd +package tls import ( "context" @@ -8,53 +8,58 @@ import ( "strings" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/main/commands/base" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/main/commands/base" ) -// CmdCert is the tls cert command -var CmdCert = &base.Command{ - UsageLine: "{{.Exec}} tls cert [--ca] [--domain=xray.com] [--expire=240h]", +// cmdCert is the tls cert command +var cmdCert = &base.Command{ + UsageLine: "{{.Exec}} tls cert [--ca] [--domain=example.com] [--expire=240h]", Short: "Generate TLS certificates", Long: ` Generate TLS certificates. -The -domain=domain_name flag sets the domain name for the -certificate. +Arguments: -The -org=organization flag sets the organization name for the -certificate. + -domain=domain_name + The domain name for the certificate. -The -ca flag sets whether this certificate is a CA + -org=organization + The organization name for the certificate. -The -json flag sets the output of certificate to JSON + -ca + Whether this certificate is a CA -The -file flag sets the certificate path to save. + -json + The output of certificate to JSON -The -expire flag expire time of the certificate. Default -value 3 months. - `, + -file + The certificate path to save. + + -expire + Expire time of the certificate. Default value 3 months. +`, } func init() { - CmdCert.Run = executeCert // break init loop + cmdCert.Run = executeCert // break init loop } var ( certDomainNames stringList _ = func() bool { - CmdCert.Flag.Var(&certDomainNames, "domain", "Domain name for the certificate") + cmdCert.Flag.Var(&certDomainNames, "domain", "Domain name for the certificate") return true }() - certCommonName = CmdCert.Flag.String("name", "Xray Inc", "The common name of this certificate") - certOrganization = CmdCert.Flag.String("org", "Xray Inc", "Organization of the certificate") - certIsCA = CmdCert.Flag.Bool("ca", false, "Whether this certificate is a CA") - certJSONOutput = CmdCert.Flag.Bool("json", true, "Print certificate in JSON format") - certFileOutput = CmdCert.Flag.String("file", "", "Save certificate in file.") - certExpire = CmdCert.Flag.Duration("expire", time.Hour*24*90 /* 90 days */, "Time until the certificate expires. Default value 3 months.") + certCommonName = cmdCert.Flag.String("name", "Xray Inc", "The common name of this certificate") + certOrganization = cmdCert.Flag.String("org", "Xray Inc", "Organization of the certificate") + certIsCA = cmdCert.Flag.Bool("ca", false, "Whether this certificate is a CA") + certJSONOutput = cmdCert.Flag.Bool("json", true, "Print certificate in JSON format") + certFileOutput = cmdCert.Flag.String("file", "", "Save certificate in file.") + certExpire = cmdCert.Flag.Duration("expire", time.Hour*24*90 /* 90 days */, "Time until the certificate expires. Default value 3 months.") ) func executeCert(cmd *base.Command, args []string) { diff --git a/main/commands/all/tlscmd/ping.go b/main/commands/all/tls/ping.go similarity index 86% rename from main/commands/all/tlscmd/ping.go rename to main/commands/all/tls/ping.go index 09772a4e7..a3697d283 100644 --- a/main/commands/all/tlscmd/ping.go +++ b/main/commands/all/tls/ping.go @@ -1,4 +1,4 @@ -package tlscmd +package tls import ( "crypto/tls" @@ -6,34 +6,37 @@ import ( "fmt" "net" - "github.com/xtls/xray-core/v1/main/commands/base" + "github.com/xtls/xray-core/main/commands/base" ) -// CmdPing is the tls ping command -var CmdPing = &base.Command{ +// cmdPing is the tls ping command +var cmdPing = &base.Command{ UsageLine: "{{.Exec}} tls ping [-ip ] ", Short: "Ping the domain with TLS handshake", Long: ` Ping the domain with TLS handshake. -The -ip flag sets the IP address of the domain. - `, +Arguments: + + -ip + The IP address of the domain. +`, } func init() { - CmdPing.Run = executePing // break init loop + cmdPing.Run = executePing // break init loop } var ( - pingIPStr = CmdPing.Flag.String("ip", "", "") + pingIPStr = cmdPing.Flag.String("ip", "", "") ) func executePing(cmd *base.Command, args []string) { - if CmdPing.Flag.NArg() < 1 { + if cmdPing.Flag.NArg() < 1 { base.Fatalf("domain not specified") } - domain := CmdPing.Flag.Arg(0) + domain := cmdPing.Flag.Arg(0) fmt.Println("Tls ping: ", domain) var ip net.IP diff --git a/main/commands/all/tls/tls.go b/main/commands/all/tls/tls.go new file mode 100644 index 000000000..55824d948 --- /dev/null +++ b/main/commands/all/tls/tls.go @@ -0,0 +1,17 @@ +package tls + +import ( + "github.com/xtls/xray-core/main/commands/base" +) + +// CmdTLS holds all tls sub commands +var CmdTLS = &base.Command{ + UsageLine: "{{.Exec}} tls", + Short: "TLS tools", + Long: `{{.Exec}} {{.LongName}} provides tools for TLS. +`, + Commands: []*base.Command{ + cmdCert, + cmdPing, + }, +} diff --git a/main/commands/all/uuid.go b/main/commands/all/uuid.go index 0fdbdb17b..ef819f178 100644 --- a/main/commands/all/uuid.go +++ b/main/commands/all/uuid.go @@ -3,8 +3,8 @@ package all import ( "fmt" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/main/commands/base" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/main/commands/base" ) var cmdUUID = &base.Command{ diff --git a/main/commands/base/command.go b/main/commands/base/command.go index 0dcdc1d33..982375956 100644 --- a/main/commands/base/command.go +++ b/main/commands/base/command.go @@ -22,13 +22,19 @@ type Command struct { Run func(cmd *Command, args []string) // UsageLine is the one-line usage message. - // The words between "go" and the first flag or argument in the line are taken to be the command name. + // The words between the first word (the "executable name") and the first flag or argument in the line are taken to be the command name. + // + // UsageLine supports go template syntax. It's recommended to use "{{.Exec}}" instead of hardcoding name UsageLine string // Short is the short description shown in the 'go help' output. + // + // Note: Short does not support go template syntax. Short string // Long is the long message shown in the 'go help ' output. + // + // Long supports go template syntax. It's recommended to use "{{.Exec}}", "{{.LongName}}" instead of hardcoding strings Long string // Flag is a set of flags specific to this command. @@ -44,16 +50,18 @@ type Command struct { Commands []*Command } -// LongName returns the command's long name: all the words in the usage line between "go" and a flag or argument, +// LongName returns the command's long name: all the words in the usage line between first word (e.g. "xray") and a flag or argument, func (c *Command) LongName() string { name := c.UsageLine if i := strings.Index(name, " ["); i >= 0 { - name = name[:i] + name = strings.TrimSpace(name[:i]) } - if name == CommandEnv.Exec { - return "" + if i := strings.Index(name, " "); i >= 0 { + name = name[i+1:] + } else { + name = "" } - return strings.TrimPrefix(name, CommandEnv.Exec+" ") + return strings.TrimSpace(name) } // Name returns the command's short name: the last word in the usage line before a flag or argument. @@ -62,11 +70,12 @@ func (c *Command) Name() string { if i := strings.LastIndex(name, " "); i >= 0 { name = name[i+1:] } - return name + return strings.TrimSpace(name) } // Usage prints usage of the Command func (c *Command) Usage() { + buildCommandText(c) fmt.Fprintf(os.Stderr, "usage: %s\n", c.UsageLine) fmt.Fprintf(os.Stderr, "Run 'xray help %s' for details.\n", c.LongName()) SetExitStatus(2) diff --git a/main/commands/base/env.go b/main/commands/base/env.go index ffb71503d..476ed133d 100644 --- a/main/commands/base/env.go +++ b/main/commands/base/env.go @@ -7,7 +7,10 @@ import ( // CommandEnvHolder is a struct holds the environment info of commands type CommandEnvHolder struct { + // Excutable name of current binary Exec string + // commands column width of current command + CommandsWidth int } // CommandEnv holds the environment info of commands diff --git a/main/commands/base/execute.go b/main/commands/base/execute.go index b0aba96b0..2d18371ec 100644 --- a/main/commands/base/execute.go +++ b/main/commands/base/execute.go @@ -14,7 +14,6 @@ import ( // Execute excute the commands func Execute() { - buildCommandsText(RootCommand) flag.Parse() args := flag.Args() if len(args) < 1 { @@ -61,6 +60,7 @@ BigCmdLoop: args = cmd.Flag.Args() } + buildCommandText(cmd) cmd.Run(cmd, args) Exit() return diff --git a/main/commands/base/help.go b/main/commands/base/help.go index 89dbb6dd2..95cdc4aea 100644 --- a/main/commands/base/help.go +++ b/main/commands/base/help.go @@ -41,6 +41,7 @@ Args: if len(cmd.Commands) > 0 { PrintUsage(os.Stdout, cmd) } else { + buildCommandText(cmd) tmpl(os.Stdout, helpTemplate, makeTmplData(cmd)) } } @@ -49,11 +50,11 @@ var usageTemplate = `{{.Long | trim}} Usage: - {{.Exec}} [arguments] + {{.UsageLine}} [arguments] The commands are: {{range .Commands}}{{if and (ne .Short "") (or (.Runnable) .Commands)}} - {{.Name | printf "%-12s"}} {{.Short}}{{end}}{{end}} + {{.Name | width $.CommandsWidth}} {{.Short}}{{end}}{{end}} Use "{{.Exec}} help{{with .LongName}} {{.}}{{end}} " for more information about a command. ` @@ -91,7 +92,7 @@ func (w *errWriter) Write(b []byte) (int, error) { // tmpl executes the given template text on data, writing the result to w. func tmpl(w io.Writer, text string, data interface{}) { t := template.New("top") - t.Funcs(template.FuncMap{"trim": strings.TrimSpace, "capitalize": capitalize}) + t.Funcs(template.FuncMap{"trim": strings.TrimSpace, "capitalize": capitalize, "width": width}) template.Must(t.Parse(text)) ew := &errWriter{w: w} err := t.Execute(ew, data) @@ -116,26 +117,28 @@ func capitalize(s string) string { return string(unicode.ToTitle(r)) + s[n:] } +func width(width int, value string) string { + format := fmt.Sprintf("%%-%ds", width) + return fmt.Sprintf(format, value) +} + // PrintUsage prints usage of cmd to w func PrintUsage(w io.Writer, cmd *Command) { + buildCommandText(cmd) bw := bufio.NewWriter(w) tmpl(bw, usageTemplate, makeTmplData(cmd)) bw.Flush() } -// buildCommandsText build text of command and its children as template -func buildCommandsText(cmd *Command) { - buildCommandText(cmd) - for _, cmd := range cmd.Commands { - buildCommandsText(cmd) - } -} - // buildCommandText build command text as template func buildCommandText(cmd *Command) { - cmd.UsageLine = buildText(cmd.UsageLine, makeTmplData(cmd)) - cmd.Short = buildText(cmd.Short, makeTmplData(cmd)) - cmd.Long = buildText(cmd.Long, makeTmplData(cmd)) + data := makeTmplData(cmd) + cmd.UsageLine = buildText(cmd.UsageLine, data) + // DO NOT SUPPORT ".Short": + // - It's not necessary + // - Or, we have to build text for all sub commands of current command, like "xray help api" + // cmd.Short = buildText(cmd.Short, data) + cmd.Long = buildText(cmd.Long, data) } func buildText(text string, data interface{}) string { @@ -150,6 +153,15 @@ type tmplData struct { } func makeTmplData(cmd *Command) tmplData { + // Minimum width of the command column + width := 12 + for _, c := range cmd.Commands { + l := len(c.Name()) + if width < l { + width = l + } + } + CommandEnv.CommandsWidth = width return tmplData{ Command: cmd, CommandEnvHolder: &CommandEnv, diff --git a/main/confloader/errors.generated.go b/main/confloader/errors.generated.go index 037851a8c..1c234856b 100644 --- a/main/confloader/errors.generated.go +++ b/main/confloader/errors.generated.go @@ -1,6 +1,6 @@ package confloader -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/main/confloader/external/errors.generated.go b/main/confloader/external/errors.generated.go index b1dcb94f2..992674b74 100644 --- a/main/confloader/external/errors.generated.go +++ b/main/confloader/external/errors.generated.go @@ -1,6 +1,6 @@ package external -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/main/confloader/external/external.go b/main/confloader/external/external.go index eaa9e8359..6a40f066c 100644 --- a/main/confloader/external/external.go +++ b/main/confloader/external/external.go @@ -1,6 +1,6 @@ package external -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "bytes" @@ -12,9 +12,9 @@ import ( "strings" "time" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/platform/ctlcmd" - "github.com/xtls/xray-core/v1/main/confloader" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/platform/ctlcmd" + "github.com/xtls/xray-core/main/confloader" ) func ConfigLoader(arg string) (out io.Reader, err error) { diff --git a/main/distro/all/all.go b/main/distro/all/all.go index b89a25f2e..ee7babf85 100644 --- a/main/distro/all/all.go +++ b/main/distro/all/all.go @@ -4,68 +4,68 @@ import ( // The following are necessary as they register handlers in their init functions. // Required features. Can't remove unless there is replacements. - _ "github.com/xtls/xray-core/v1/app/dispatcher" - _ "github.com/xtls/xray-core/v1/app/proxyman/inbound" - _ "github.com/xtls/xray-core/v1/app/proxyman/outbound" + _ "github.com/xtls/xray-core/app/dispatcher" + _ "github.com/xtls/xray-core/app/proxyman/inbound" + _ "github.com/xtls/xray-core/app/proxyman/outbound" // Default commander and all its services. This is an optional feature. - _ "github.com/xtls/xray-core/v1/app/commander" - _ "github.com/xtls/xray-core/v1/app/log/command" - _ "github.com/xtls/xray-core/v1/app/proxyman/command" - _ "github.com/xtls/xray-core/v1/app/stats/command" + _ "github.com/xtls/xray-core/app/commander" + _ "github.com/xtls/xray-core/app/log/command" + _ "github.com/xtls/xray-core/app/proxyman/command" + _ "github.com/xtls/xray-core/app/stats/command" // Other optional features. - _ "github.com/xtls/xray-core/v1/app/dns" - _ "github.com/xtls/xray-core/v1/app/log" - _ "github.com/xtls/xray-core/v1/app/policy" - _ "github.com/xtls/xray-core/v1/app/reverse" - _ "github.com/xtls/xray-core/v1/app/router" - _ "github.com/xtls/xray-core/v1/app/stats" + _ "github.com/xtls/xray-core/app/dns" + _ "github.com/xtls/xray-core/app/log" + _ "github.com/xtls/xray-core/app/policy" + _ "github.com/xtls/xray-core/app/reverse" + _ "github.com/xtls/xray-core/app/router" + _ "github.com/xtls/xray-core/app/stats" // Inbound and outbound proxies. - _ "github.com/xtls/xray-core/v1/proxy/blackhole" - _ "github.com/xtls/xray-core/v1/proxy/dns" - _ "github.com/xtls/xray-core/v1/proxy/dokodemo" - _ "github.com/xtls/xray-core/v1/proxy/freedom" - _ "github.com/xtls/xray-core/v1/proxy/http" - _ "github.com/xtls/xray-core/v1/proxy/mtproto" - _ "github.com/xtls/xray-core/v1/proxy/shadowsocks" - _ "github.com/xtls/xray-core/v1/proxy/socks" - _ "github.com/xtls/xray-core/v1/proxy/trojan" - _ "github.com/xtls/xray-core/v1/proxy/vless/inbound" - _ "github.com/xtls/xray-core/v1/proxy/vless/outbound" - _ "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - _ "github.com/xtls/xray-core/v1/proxy/vmess/outbound" + _ "github.com/xtls/xray-core/proxy/blackhole" + _ "github.com/xtls/xray-core/proxy/dns" + _ "github.com/xtls/xray-core/proxy/dokodemo" + _ "github.com/xtls/xray-core/proxy/freedom" + _ "github.com/xtls/xray-core/proxy/http" + _ "github.com/xtls/xray-core/proxy/mtproto" + _ "github.com/xtls/xray-core/proxy/shadowsocks" + _ "github.com/xtls/xray-core/proxy/socks" + _ "github.com/xtls/xray-core/proxy/trojan" + _ "github.com/xtls/xray-core/proxy/vless/inbound" + _ "github.com/xtls/xray-core/proxy/vless/outbound" + _ "github.com/xtls/xray-core/proxy/vmess/inbound" + _ "github.com/xtls/xray-core/proxy/vmess/outbound" // Transports - _ "github.com/xtls/xray-core/v1/transport/internet/domainsocket" - _ "github.com/xtls/xray-core/v1/transport/internet/http" - _ "github.com/xtls/xray-core/v1/transport/internet/kcp" - _ "github.com/xtls/xray-core/v1/transport/internet/quic" - _ "github.com/xtls/xray-core/v1/transport/internet/tcp" - _ "github.com/xtls/xray-core/v1/transport/internet/tls" - _ "github.com/xtls/xray-core/v1/transport/internet/udp" - _ "github.com/xtls/xray-core/v1/transport/internet/websocket" - _ "github.com/xtls/xray-core/v1/transport/internet/xtls" + _ "github.com/xtls/xray-core/transport/internet/domainsocket" + _ "github.com/xtls/xray-core/transport/internet/http" + _ "github.com/xtls/xray-core/transport/internet/kcp" + _ "github.com/xtls/xray-core/transport/internet/quic" + _ "github.com/xtls/xray-core/transport/internet/tcp" + _ "github.com/xtls/xray-core/transport/internet/tls" + _ "github.com/xtls/xray-core/transport/internet/udp" + _ "github.com/xtls/xray-core/transport/internet/websocket" + _ "github.com/xtls/xray-core/transport/internet/xtls" // Transport headers - _ "github.com/xtls/xray-core/v1/transport/internet/headers/http" - _ "github.com/xtls/xray-core/v1/transport/internet/headers/noop" - _ "github.com/xtls/xray-core/v1/transport/internet/headers/srtp" - _ "github.com/xtls/xray-core/v1/transport/internet/headers/tls" - _ "github.com/xtls/xray-core/v1/transport/internet/headers/utp" - _ "github.com/xtls/xray-core/v1/transport/internet/headers/wechat" - _ "github.com/xtls/xray-core/v1/transport/internet/headers/wireguard" + _ "github.com/xtls/xray-core/transport/internet/headers/http" + _ "github.com/xtls/xray-core/transport/internet/headers/noop" + _ "github.com/xtls/xray-core/transport/internet/headers/srtp" + _ "github.com/xtls/xray-core/transport/internet/headers/tls" + _ "github.com/xtls/xray-core/transport/internet/headers/utp" + _ "github.com/xtls/xray-core/transport/internet/headers/wechat" + _ "github.com/xtls/xray-core/transport/internet/headers/wireguard" // JSON config support. Choose only one from the two below. // The following line loads JSON from xctl - // _ "github.com/xtls/xray-core/v1/main/json" + // _ "github.com/xtls/xray-core/main/json" // The following line loads JSON internally - _ "github.com/xtls/xray-core/v1/main/jsonem" + _ "github.com/xtls/xray-core/main/jsonem" // Load config from file or http(s) - _ "github.com/xtls/xray-core/v1/main/confloader/external" + _ "github.com/xtls/xray-core/main/confloader/external" // commands - _ "github.com/xtls/xray-core/v1/main/commands/all" + _ "github.com/xtls/xray-core/main/commands/all" ) diff --git a/main/errors.generated.go b/main/errors.generated.go index 4287a6d9b..e898cb5f5 100644 --- a/main/errors.generated.go +++ b/main/errors.generated.go @@ -1,6 +1,6 @@ package main -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/main/json/config_json.go b/main/json/config_json.go index 5514bea20..90a169a09 100644 --- a/main/json/config_json.go +++ b/main/json/config_json.go @@ -1,15 +1,15 @@ package json -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "io" "os" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/cmdarg" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/main/confloader" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/cmdarg" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/main/confloader" ) func init() { diff --git a/main/json/errors.generated.go b/main/json/errors.generated.go index 71d741bf7..2c1b1452a 100644 --- a/main/json/errors.generated.go +++ b/main/json/errors.generated.go @@ -1,6 +1,6 @@ package json -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/main/jsonem/errors.generated.go b/main/jsonem/errors.generated.go index ac1760f36..1c3f60e95 100644 --- a/main/jsonem/errors.generated.go +++ b/main/jsonem/errors.generated.go @@ -1,6 +1,6 @@ package jsonem -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/main/jsonem/jsonem.go b/main/jsonem/jsonem.go index 66a16bc41..cf9227aae 100644 --- a/main/jsonem/jsonem.go +++ b/main/jsonem/jsonem.go @@ -3,12 +3,12 @@ package jsonem import ( "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/cmdarg" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/infra/conf/serial" - "github.com/xtls/xray-core/v1/main/confloader" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/cmdarg" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/infra/conf/serial" + "github.com/xtls/xray-core/main/confloader" ) func init() { @@ -19,12 +19,18 @@ func init() { switch v := input.(type) { case cmdarg.Arg: cf := &conf.Config{} - for _, arg := range v { + for i, arg := range v { newError("Reading config: ", arg).AtInfo().WriteToLog() r, err := confloader.LoadConfig(arg) common.Must(err) c, err := serial.DecodeJSONConfig(r) common.Must(err) + if i == 0 { + // This ensure even if the muti-json parser do not support a setting, + // It is still respected automatically for the first configure file + *cf = *c + continue + } cf.Override(c, arg) } return cf.Build() diff --git a/main/main.go b/main/main.go index e3759cf39..22d60bdf9 100644 --- a/main/main.go +++ b/main/main.go @@ -4,8 +4,8 @@ import ( "flag" "os" - "github.com/xtls/xray-core/v1/main/commands/base" - _ "github.com/xtls/xray-core/v1/main/distro/all" + "github.com/xtls/xray-core/main/commands/base" + _ "github.com/xtls/xray-core/main/distro/all" ) func main() { diff --git a/main/run.go b/main/run.go index b9349c75e..1f794cc20 100644 --- a/main/run.go +++ b/main/run.go @@ -12,10 +12,10 @@ import ( "strings" "syscall" - "github.com/xtls/xray-core/v1/common/cmdarg" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/main/commands/base" + "github.com/xtls/xray-core/common/cmdarg" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/main/commands/base" ) var cmdRun = &base.Command{ diff --git a/main/version.go b/main/version.go index 730372e3a..9c1fa736a 100644 --- a/main/version.go +++ b/main/version.go @@ -3,8 +3,8 @@ package main import ( "fmt" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/main/commands/base" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/main/commands/base" ) var cmdVersion = &base.Command{ diff --git a/proxy/blackhole/blackhole.go b/proxy/blackhole/blackhole.go index 82320b0d1..526332dcd 100644 --- a/proxy/blackhole/blackhole.go +++ b/proxy/blackhole/blackhole.go @@ -3,15 +3,15 @@ // Package blackhole is an outbound handler that blocks all connections. package blackhole -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) // Handler is an outbound connection that silently swallow the entire payload. diff --git a/proxy/blackhole/blackhole_test.go b/proxy/blackhole/blackhole_test.go index 84c1ed454..8e487e0c1 100644 --- a/proxy/blackhole/blackhole_test.go +++ b/proxy/blackhole/blackhole_test.go @@ -4,12 +4,12 @@ import ( "context" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/blackhole" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/blackhole" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/pipe" ) func TestBlackholeHTTPResponse(t *testing.T) { diff --git a/proxy/blackhole/config.go b/proxy/blackhole/config.go index f31d79775..b0f8e60ce 100644 --- a/proxy/blackhole/config.go +++ b/proxy/blackhole/config.go @@ -1,8 +1,8 @@ package blackhole import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" ) const ( diff --git a/proxy/blackhole/config.pb.go b/proxy/blackhole/config.pb.go index d0010e5dd..08ffed361 100644 --- a/proxy/blackhole/config.pb.go +++ b/proxy/blackhole/config.pb.go @@ -8,7 +8,7 @@ package blackhole import ( proto "github.com/golang/protobuf/proto" - serial "github.com/xtls/xray-core/v1/common/serial" + serial "github.com/xtls/xray-core/common/serial" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -164,13 +164,13 @@ var file_proxy_blackhole_config_proto_rawDesc = []byte{ 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x61, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0x50, 0x01, 0x5a, 0x2c, 0x67, + 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, - 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2f, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0xaa, 0x02, 0x14, 0x58, 0x72, - 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, - 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x62, + 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/blackhole/config.proto b/proxy/blackhole/config.proto index d1dbfcee9..3214c1b56 100644 --- a/proxy/blackhole/config.proto +++ b/proxy/blackhole/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.blackhole; option csharp_namespace = "Xray.Proxy.Blackhole"; -option go_package = "github.com/xtls/xray-core/v1/proxy/blackhole"; +option go_package = "github.com/xtls/xray-core/proxy/blackhole"; option java_package = "com.xray.proxy.blackhole"; option java_multiple_files = true; diff --git a/proxy/blackhole/config_test.go b/proxy/blackhole/config_test.go index 5f3e5113b..f2755b50d 100644 --- a/proxy/blackhole/config_test.go +++ b/proxy/blackhole/config_test.go @@ -5,9 +5,9 @@ import ( "net/http" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/proxy/blackhole" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/proxy/blackhole" ) func TestHTTPResponse(t *testing.T) { diff --git a/proxy/blackhole/errors.generated.go b/proxy/blackhole/errors.generated.go index 5def7a78e..344f86cbb 100644 --- a/proxy/blackhole/errors.generated.go +++ b/proxy/blackhole/errors.generated.go @@ -1,6 +1,6 @@ package blackhole -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/dns/config.pb.go b/proxy/dns/config.pb.go index 0c0a8991f..62b7bf8d8 100644 --- a/proxy/dns/config.pb.go +++ b/proxy/dns/config.pb.go @@ -8,7 +8,7 @@ package dns import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" + net "github.com/xtls/xray-core/common/net" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -86,12 +86,12 @@ var file_proxy_dns_config_proto_rawDesc = []byte{ 0x12, 0x31, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x42, 0x4f, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, + 0x76, 0x65, 0x72, 0x42, 0x4c, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, - 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, - 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x0e, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, - 0x2e, 0x44, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x64, 0x6e, 0x73, + 0xaa, 0x02, 0x0e, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x44, 0x6e, + 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/dns/config.proto b/proxy/dns/config.proto index 0e59f2ac5..d4f4a308e 100644 --- a/proxy/dns/config.proto +++ b/proxy/dns/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.dns; option csharp_namespace = "Xray.Proxy.Dns"; -option go_package = "github.com/xtls/xray-core/v1/proxy/dns"; +option go_package = "github.com/xtls/xray-core/proxy/dns"; option java_package = "com.xray.proxy.dns"; option java_multiple_files = true; diff --git a/proxy/dns/dns.go b/proxy/dns/dns.go index 1326a664c..89f492098 100644 --- a/proxy/dns/dns.go +++ b/proxy/dns/dns.go @@ -9,16 +9,16 @@ import ( "golang.org/x/net/dns/dnsmessage" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - dns_proto "github.com/xtls/xray-core/v1/common/protocol/dns" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + dns_proto "github.com/xtls/xray-core/common/protocol/dns" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) func init() { diff --git a/proxy/dns/dns_test.go b/proxy/dns/dns_test.go index 92bd8e9bf..cc43c2510 100644 --- a/proxy/dns/dns_test.go +++ b/proxy/dns/dns_test.go @@ -8,20 +8,20 @@ import ( "github.com/google/go-cmp/cmp" "github.com/miekg/dns" - "github.com/xtls/xray-core/v1/app/dispatcher" - dnsapp "github.com/xtls/xray-core/v1/app/dns" - "github.com/xtls/xray-core/v1/app/policy" - "github.com/xtls/xray-core/v1/app/proxyman" - _ "github.com/xtls/xray-core/v1/app/proxyman/inbound" - _ "github.com/xtls/xray-core/v1/app/proxyman/outbound" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/core" - dns_proxy "github.com/xtls/xray-core/v1/proxy/dns" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" + "github.com/xtls/xray-core/app/dispatcher" + dnsapp "github.com/xtls/xray-core/app/dns" + "github.com/xtls/xray-core/app/policy" + "github.com/xtls/xray-core/app/proxyman" + _ "github.com/xtls/xray-core/app/proxyman/inbound" + _ "github.com/xtls/xray-core/app/proxyman/outbound" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/core" + dns_proxy "github.com/xtls/xray-core/proxy/dns" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" ) type staticHandler struct { diff --git a/proxy/dns/errors.generated.go b/proxy/dns/errors.generated.go index ce4c0605e..d7375a9b9 100644 --- a/proxy/dns/errors.generated.go +++ b/proxy/dns/errors.generated.go @@ -1,6 +1,6 @@ package dns -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/dokodemo/config.go b/proxy/dokodemo/config.go index 12f1086b0..bb3670515 100644 --- a/proxy/dokodemo/config.go +++ b/proxy/dokodemo/config.go @@ -1,7 +1,7 @@ package dokodemo import ( - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) // GetPredefinedAddress returns the defined address from proto config. Null if address is not valid. diff --git a/proxy/dokodemo/config.pb.go b/proxy/dokodemo/config.pb.go index 18c5af496..e176ac4d0 100644 --- a/proxy/dokodemo/config.pb.go +++ b/proxy/dokodemo/config.pb.go @@ -8,7 +8,7 @@ package dokodemo import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" + net "github.com/xtls/xray-core/common/net" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -157,14 +157,14 @@ var file_proxy_dokodemo_config_proto_rawDesc = []byte{ 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x42, 0x5e, 0x0a, + 0x28, 0x0d, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x42, 0x5b, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x64, 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, + 0x64, 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x64, - 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0xaa, 0x02, 0x13, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x44, 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x64, 0x6f, 0x6b, 0x6f, + 0x64, 0x65, 0x6d, 0x6f, 0xaa, 0x02, 0x13, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x44, 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/proxy/dokodemo/config.proto b/proxy/dokodemo/config.proto index a12f99077..6b5b262bc 100644 --- a/proxy/dokodemo/config.proto +++ b/proxy/dokodemo/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.dokodemo; option csharp_namespace = "Xray.Proxy.Dokodemo"; -option go_package = "github.com/xtls/xray-core/v1/proxy/dokodemo"; +option go_package = "github.com/xtls/xray-core/proxy/dokodemo"; option java_package = "com.xray.proxy.dokodemo"; option java_multiple_files = true; diff --git a/proxy/dokodemo/dokodemo.go b/proxy/dokodemo/dokodemo.go index dba806720..e9bb975f8 100644 --- a/proxy/dokodemo/dokodemo.go +++ b/proxy/dokodemo/dokodemo.go @@ -2,25 +2,25 @@ package dokodemo -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "sync/atomic" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet" ) func init() { diff --git a/proxy/dokodemo/errors.generated.go b/proxy/dokodemo/errors.generated.go index d570d667f..cc4fd09ca 100644 --- a/proxy/dokodemo/errors.generated.go +++ b/proxy/dokodemo/errors.generated.go @@ -1,6 +1,6 @@ package dokodemo -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/freedom/config.pb.go b/proxy/freedom/config.pb.go index f929118d9..d06f0147d 100644 --- a/proxy/freedom/config.pb.go +++ b/proxy/freedom/config.pb.go @@ -8,7 +8,7 @@ package freedom import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -231,13 +231,13 @@ var file_proxy_freedom_config_proto_rawDesc = []byte{ 0x67, 0x79, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x53, 0x5f, 0x49, 0x53, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, - 0x36, 0x10, 0x03, 0x42, 0x5b, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, + 0x36, 0x10, 0x03, 0x42, 0x58, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x50, 0x01, 0x5a, - 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, - 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2f, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0xaa, 0x02, 0x12, 0x58, 0x72, - 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x46, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, + 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2f, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x46, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/freedom/config.proto b/proxy/freedom/config.proto index eb0de1ad9..7578a43fb 100644 --- a/proxy/freedom/config.proto +++ b/proxy/freedom/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.freedom; option csharp_namespace = "Xray.Proxy.Freedom"; -option go_package = "github.com/xtls/xray-core/v1/proxy/freedom"; +option go_package = "github.com/xtls/xray-core/proxy/freedom"; option java_package = "com.xray.proxy.freedom"; option java_multiple_files = true; diff --git a/proxy/freedom/errors.generated.go b/proxy/freedom/errors.generated.go index f6c1cb83c..344fbb2fd 100644 --- a/proxy/freedom/errors.generated.go +++ b/proxy/freedom/errors.generated.go @@ -1,6 +1,6 @@ package freedom -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/freedom/freedom.go b/proxy/freedom/freedom.go index fb7a8ff0e..c0f887a70 100644 --- a/proxy/freedom/freedom.go +++ b/proxy/freedom/freedom.go @@ -2,25 +2,25 @@ package freedom -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) func init() { diff --git a/proxy/http/client.go b/proxy/http/client.go index 0010a3306..8f8ffa425 100644 --- a/proxy/http/client.go +++ b/proxy/http/client.go @@ -13,20 +13,20 @@ import ( "golang.org/x/net/http2" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/bytespool" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/bytespool" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" ) type Client struct { diff --git a/proxy/http/config.go b/proxy/http/config.go index e12bd43c5..00ce0795b 100644 --- a/proxy/http/config.go +++ b/proxy/http/config.go @@ -1,7 +1,7 @@ package http import ( - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common/protocol" ) func (a *Account) Equals(another protocol.Account) bool { diff --git a/proxy/http/config.pb.go b/proxy/http/config.pb.go index 79966d11c..b5a538643 100644 --- a/proxy/http/config.pb.go +++ b/proxy/http/config.pb.go @@ -8,7 +8,7 @@ package http import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -237,12 +237,12 @@ var file_proxy_http_config_proto_rawDesc = []byte{ 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x42, - 0x52, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x68, 0x74, 0x74, - 0x70, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x48, - 0x74, 0x74, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x68, 0x74, 0x74, 0x70, 0xaa, 0x02, + 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x48, 0x74, 0x74, 0x70, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/http/config.proto b/proxy/http/config.proto index 212e7227b..bcb11ebfe 100644 --- a/proxy/http/config.proto +++ b/proxy/http/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.http; option csharp_namespace = "Xray.Proxy.Http"; -option go_package = "github.com/xtls/xray-core/v1/proxy/http"; +option go_package = "github.com/xtls/xray-core/proxy/http"; option java_package = "com.xray.proxy.http"; option java_multiple_files = true; diff --git a/proxy/http/errors.generated.go b/proxy/http/errors.generated.go index b07b3feca..f00481654 100644 --- a/proxy/http/errors.generated.go +++ b/proxy/http/errors.generated.go @@ -1,6 +1,6 @@ package http -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/http/http.go b/proxy/http/http.go index 9dc785321..3c0d015f0 100644 --- a/proxy/http/http.go +++ b/proxy/http/http.go @@ -1,3 +1,3 @@ package http -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/proxy/http/server.go b/proxy/http/server.go index acdc16657..e3ff8d68d 100644 --- a/proxy/http/server.go +++ b/proxy/http/server.go @@ -11,20 +11,20 @@ import ( "strings" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - http_proto "github.com/xtls/xray-core/v1/common/protocol/http" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + http_proto "github.com/xtls/xray-core/common/protocol/http" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet" ) // Server is an HTTP proxy server. diff --git a/proxy/mtproto/auth.go b/proxy/mtproto/auth.go index 1261d199d..00857d73a 100644 --- a/proxy/mtproto/auth.go +++ b/proxy/mtproto/auth.go @@ -7,7 +7,7 @@ import ( "io" "sync" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) const ( diff --git a/proxy/mtproto/auth_test.go b/proxy/mtproto/auth_test.go index 3bdff5939..9fc6a9a08 100644 --- a/proxy/mtproto/auth_test.go +++ b/proxy/mtproto/auth_test.go @@ -7,8 +7,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/proxy/mtproto" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/proxy/mtproto" ) func TestInverse(t *testing.T) { diff --git a/proxy/mtproto/client.go b/proxy/mtproto/client.go index 6c2f44391..ee4e7a8ea 100644 --- a/proxy/mtproto/client.go +++ b/proxy/mtproto/client.go @@ -3,14 +3,14 @@ package mtproto import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/crypto" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) type Client struct { diff --git a/proxy/mtproto/config.go b/proxy/mtproto/config.go index 016efcde6..fcd203d70 100644 --- a/proxy/mtproto/config.go +++ b/proxy/mtproto/config.go @@ -1,7 +1,7 @@ package mtproto import ( - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common/protocol" ) func (a *Account) Equals(another protocol.Account) bool { diff --git a/proxy/mtproto/config.pb.go b/proxy/mtproto/config.pb.go index 268dc44cd..c8bb8d04a 100644 --- a/proxy/mtproto/config.pb.go +++ b/proxy/mtproto/config.pb.go @@ -8,7 +8,7 @@ package mtproto import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -176,13 +176,13 @@ var file_proxy_mtproto_config_proto_rawDesc = []byte{ 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x0e, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, - 0x5b, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x6d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, + 0x58, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x6d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, - 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, - 0x6d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x4d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x6d, 0x74, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x4d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/proxy/mtproto/config.proto b/proxy/mtproto/config.proto index 20be75693..65997bc00 100644 --- a/proxy/mtproto/config.proto +++ b/proxy/mtproto/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.mtproto; option csharp_namespace = "Xray.Proxy.Mtproto"; -option go_package = "github.com/xtls/xray-core/v1/proxy/mtproto"; +option go_package = "github.com/xtls/xray-core/proxy/mtproto"; option java_package = "com.xray.proxy.mtproto"; option java_multiple_files = true; diff --git a/proxy/mtproto/errors.generated.go b/proxy/mtproto/errors.generated.go index 5dd70350f..012202d67 100644 --- a/proxy/mtproto/errors.generated.go +++ b/proxy/mtproto/errors.generated.go @@ -1,6 +1,6 @@ package mtproto -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/mtproto/mtproto.go b/proxy/mtproto/mtproto.go index 2103186d7..af7983a5c 100644 --- a/proxy/mtproto/mtproto.go +++ b/proxy/mtproto/mtproto.go @@ -1,3 +1,3 @@ package mtproto -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/proxy/mtproto/server.go b/proxy/mtproto/server.go index 6e4d3ddce..df3e14391 100644 --- a/proxy/mtproto/server.go +++ b/proxy/mtproto/server.go @@ -7,18 +7,18 @@ import ( "context" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/crypto" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet" ) var ( diff --git a/proxy/proxy.go b/proxy/proxy.go index 59b95a5a8..a32a1ef1e 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -8,11 +8,11 @@ package proxy import ( "context" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) // An Inbound processes inbound connections. diff --git a/proxy/shadowsocks/client.go b/proxy/shadowsocks/client.go index 94a984ab2..0a2254edf 100644 --- a/proxy/shadowsocks/client.go +++ b/proxy/shadowsocks/client.go @@ -5,18 +5,18 @@ package shadowsocks import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) // Client is a inbound handler for Shadowsocks protocol diff --git a/proxy/shadowsocks/config.go b/proxy/shadowsocks/config.go index 5c21541fd..dfc3ce3d1 100644 --- a/proxy/shadowsocks/config.go +++ b/proxy/shadowsocks/config.go @@ -11,10 +11,10 @@ import ( "golang.org/x/crypto/chacha20poly1305" "golang.org/x/crypto/hkdf" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/crypto" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/protocol" ) // MemoryAccount is an account type converted from Account. diff --git a/proxy/shadowsocks/config.pb.go b/proxy/shadowsocks/config.pb.go index b32f92bca..fcf321d95 100644 --- a/proxy/shadowsocks/config.pb.go +++ b/proxy/shadowsocks/config.pb.go @@ -8,8 +8,8 @@ package shadowsocks import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" - protocol "github.com/xtls/xray-core/v1/common/protocol" + net "github.com/xtls/xray-core/common/net" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -307,14 +307,14 @@ var file_proxy_shadowsocks_config_proto_rawDesc = []byte{ 0x47, 0x43, 0x4d, 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47, 0x43, 0x4d, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x48, 0x41, 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x10, 0x07, 0x12, 0x08, 0x0a, - 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x08, 0x42, 0x67, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x78, + 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x08, 0x42, 0x64, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, - 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, - 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x73, 0x68, 0x61, 0x64, - 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0xaa, 0x02, 0x16, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, + 0x6f, 0x63, 0x6b, 0x73, 0xaa, 0x02, 0x16, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x53, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/shadowsocks/config.proto b/proxy/shadowsocks/config.proto index baab7c029..8d5bb5025 100644 --- a/proxy/shadowsocks/config.proto +++ b/proxy/shadowsocks/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.shadowsocks; option csharp_namespace = "Xray.Proxy.Shadowsocks"; -option go_package = "github.com/xtls/xray-core/v1/proxy/shadowsocks"; +option go_package = "github.com/xtls/xray-core/proxy/shadowsocks"; option java_package = "com.xray.proxy.shadowsocks"; option java_multiple_files = true; diff --git a/proxy/shadowsocks/config_test.go b/proxy/shadowsocks/config_test.go index 49d99d051..cfc7a43b6 100644 --- a/proxy/shadowsocks/config_test.go +++ b/proxy/shadowsocks/config_test.go @@ -6,9 +6,9 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/proxy/shadowsocks" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/proxy/shadowsocks" ) func TestAEADCipherUDP(t *testing.T) { diff --git a/proxy/shadowsocks/errors.generated.go b/proxy/shadowsocks/errors.generated.go index 8b1b33d9a..dd33902bd 100644 --- a/proxy/shadowsocks/errors.generated.go +++ b/proxy/shadowsocks/errors.generated.go @@ -1,6 +1,6 @@ package shadowsocks -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/shadowsocks/protocol.go b/proxy/shadowsocks/protocol.go index 8322b52ec..1f5f4bbc1 100644 --- a/proxy/shadowsocks/protocol.go +++ b/proxy/shadowsocks/protocol.go @@ -10,11 +10,11 @@ import ( "io" "io/ioutil" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" ) const ( diff --git a/proxy/shadowsocks/protocol_test.go b/proxy/shadowsocks/protocol_test.go index 43fa331b3..5429a8b96 100644 --- a/proxy/shadowsocks/protocol_test.go +++ b/proxy/shadowsocks/protocol_test.go @@ -5,11 +5,11 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - . "github.com/xtls/xray-core/v1/proxy/shadowsocks" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + . "github.com/xtls/xray-core/proxy/shadowsocks" ) func toAccount(a *Account) protocol.Account { diff --git a/proxy/shadowsocks/server.go b/proxy/shadowsocks/server.go index b16fcf3ea..7134fb9cb 100644 --- a/proxy/shadowsocks/server.go +++ b/proxy/shadowsocks/server.go @@ -6,20 +6,20 @@ import ( "context" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - udp_proto "github.com/xtls/xray-core/v1/common/protocol/udp" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/udp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + udp_proto "github.com/xtls/xray-core/common/protocol/udp" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/udp" ) type Server struct { diff --git a/proxy/shadowsocks/shadowsocks.go b/proxy/shadowsocks/shadowsocks.go index 5214a24c4..6d950db27 100644 --- a/proxy/shadowsocks/shadowsocks.go +++ b/proxy/shadowsocks/shadowsocks.go @@ -5,4 +5,4 @@ // R.I.P Shadowsocks package shadowsocks -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/proxy/socks/client.go b/proxy/socks/client.go index 5266dbd0c..568f5d708 100644 --- a/proxy/socks/client.go +++ b/proxy/socks/client.go @@ -6,18 +6,18 @@ import ( "context" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) // Client is a Socks5 client. diff --git a/proxy/socks/config.go b/proxy/socks/config.go index 170746309..1d0ae6ec3 100644 --- a/proxy/socks/config.go +++ b/proxy/socks/config.go @@ -2,7 +2,7 @@ package socks -import "github.com/xtls/xray-core/v1/common/protocol" +import "github.com/xtls/xray-core/common/protocol" func (a *Account) Equals(another protocol.Account) bool { if account, ok := another.(*Account); ok { diff --git a/proxy/socks/config.pb.go b/proxy/socks/config.pb.go index c6c271501..7557d07e4 100644 --- a/proxy/socks/config.pb.go +++ b/proxy/socks/config.pb.go @@ -8,8 +8,8 @@ package socks import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" - protocol "github.com/xtls/xray-core/v1/common/protocol" + net "github.com/xtls/xray-core/common/net" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -314,13 +314,13 @@ var file_proxy_socks_config_proto_rawDesc = []byte{ 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2a, 0x25, 0x0a, 0x08, 0x41, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4e, 0x4f, 0x5f, 0x41, 0x55, 0x54, 0x48, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x41, 0x53, - 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x42, 0x55, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x78, + 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x42, 0x52, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x50, - 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, - 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0xaa, 0x02, 0x10, 0x58, 0x72, - 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, + 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x78, 0x79, 0x2f, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0xaa, 0x02, 0x10, 0x58, 0x72, 0x61, 0x79, 0x2e, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/socks/config.proto b/proxy/socks/config.proto index ff1c13856..994663bbf 100644 --- a/proxy/socks/config.proto +++ b/proxy/socks/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.socks; option csharp_namespace = "Xray.Proxy.Socks"; -option go_package = "github.com/xtls/xray-core/v1/proxy/socks"; +option go_package = "github.com/xtls/xray-core/proxy/socks"; option java_package = "com.xray.proxy.socks"; option java_multiple_files = true; diff --git a/proxy/socks/errors.generated.go b/proxy/socks/errors.generated.go index 023bf9e0d..f466011df 100644 --- a/proxy/socks/errors.generated.go +++ b/proxy/socks/errors.generated.go @@ -1,6 +1,6 @@ package socks -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/socks/protocol.go b/proxy/socks/protocol.go index 20b91dd08..ce8e1f22d 100644 --- a/proxy/socks/protocol.go +++ b/proxy/socks/protocol.go @@ -6,10 +6,10 @@ import ( "encoding/binary" "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" ) const ( diff --git a/proxy/socks/protocol_test.go b/proxy/socks/protocol_test.go index 861d7a0b5..006fb7f1c 100644 --- a/proxy/socks/protocol_test.go +++ b/proxy/socks/protocol_test.go @@ -6,11 +6,11 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - . "github.com/xtls/xray-core/v1/proxy/socks" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + . "github.com/xtls/xray-core/proxy/socks" ) func TestUDPEncoding(t *testing.T) { diff --git a/proxy/socks/server.go b/proxy/socks/server.go index 8633146eb..de24ad1e6 100644 --- a/proxy/socks/server.go +++ b/proxy/socks/server.go @@ -7,21 +7,21 @@ import ( "io" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - udp_proto "github.com/xtls/xray-core/v1/common/protocol/udp" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/udp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + udp_proto "github.com/xtls/xray-core/common/protocol/udp" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/udp" ) // Server is a SOCKS 5 proxy server diff --git a/proxy/socks/socks.go b/proxy/socks/socks.go index f268b02e6..557609c7a 100644 --- a/proxy/socks/socks.go +++ b/proxy/socks/socks.go @@ -1,4 +1,4 @@ // Package socks provides implements of Socks protocol 4, 4a and 5. package socks -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/proxy/trojan/client.go b/proxy/trojan/client.go index f7f2b0e57..a12193432 100644 --- a/proxy/trojan/client.go +++ b/proxy/trojan/client.go @@ -7,21 +7,21 @@ import ( "syscall" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/xtls" ) // Client is a inbound handler for trojan protocol diff --git a/proxy/trojan/config.go b/proxy/trojan/config.go index 05c4e50e1..ffac7854c 100644 --- a/proxy/trojan/config.go +++ b/proxy/trojan/config.go @@ -5,8 +5,8 @@ import ( "encoding/hex" fmt "fmt" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/protocol" ) // MemoryAccount is an account type converted from Account. diff --git a/proxy/trojan/config.pb.go b/proxy/trojan/config.pb.go index 85b8b7adf..391a7569f 100644 --- a/proxy/trojan/config.pb.go +++ b/proxy/trojan/config.pb.go @@ -8,7 +8,7 @@ package trojan import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -295,13 +295,13 @@ var file_proxy_trojan_config_proto_rawDesc = []byte{ 0x62, 0x61, 0x63, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x46, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x09, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, - 0x63, 0x6b, 0x73, 0x42, 0x58, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x50, 0x01, 0x5a, 0x29, + 0x63, 0x6b, 0x73, 0x42, 0x55, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x50, 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, - 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2f, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0xaa, 0x02, 0x11, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x54, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, + 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0xaa, 0x02, 0x11, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x54, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/proxy/trojan/config.proto b/proxy/trojan/config.proto index 1fb865a8d..b4376a82f 100644 --- a/proxy/trojan/config.proto +++ b/proxy/trojan/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.trojan; option csharp_namespace = "Xray.Proxy.Trojan"; -option go_package = "github.com/xtls/xray-core/v1/proxy/trojan"; +option go_package = "github.com/xtls/xray-core/proxy/trojan"; option java_package = "com.xray.proxy.trojan"; option java_multiple_files = true; diff --git a/proxy/trojan/errors.generated.go b/proxy/trojan/errors.generated.go index 10d02653e..7fb812794 100644 --- a/proxy/trojan/errors.generated.go +++ b/proxy/trojan/errors.generated.go @@ -1,6 +1,6 @@ package trojan -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/trojan/protocol.go b/proxy/trojan/protocol.go index ff8e83ebd..3b1611633 100644 --- a/proxy/trojan/protocol.go +++ b/proxy/trojan/protocol.go @@ -6,13 +6,13 @@ import ( "io" "syscall" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/transport/internet/xtls" ) var ( diff --git a/proxy/trojan/protocol_test.go b/proxy/trojan/protocol_test.go index da23035be..ea1cf7ac3 100644 --- a/proxy/trojan/protocol_test.go +++ b/proxy/trojan/protocol_test.go @@ -4,11 +4,11 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - . "github.com/xtls/xray-core/v1/proxy/trojan" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + . "github.com/xtls/xray-core/proxy/trojan" ) func toAccount(a *Account) protocol.Account { diff --git a/proxy/trojan/server.go b/proxy/trojan/server.go index a0e857b0f..9f0d3e58e 100644 --- a/proxy/trojan/server.go +++ b/proxy/trojan/server.go @@ -10,25 +10,25 @@ import ( "syscall" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/protocol" - udp_proto "github.com/xtls/xray-core/v1/common/protocol/udp" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/udp" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/protocol" + udp_proto "github.com/xtls/xray-core/common/protocol/udp" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/udp" + "github.com/xtls/xray-core/transport/internet/xtls" ) func init() { diff --git a/proxy/trojan/validator.go b/proxy/trojan/validator.go index 7ea503e1e..4279934e6 100644 --- a/proxy/trojan/validator.go +++ b/proxy/trojan/validator.go @@ -6,7 +6,7 @@ import ( "strings" "sync" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common/protocol" ) // Validator stores valid trojan users. diff --git a/proxy/vless/account.go b/proxy/vless/account.go index 03563653d..c6dfdb721 100644 --- a/proxy/vless/account.go +++ b/proxy/vless/account.go @@ -3,8 +3,8 @@ package vless import ( - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" ) // AsAccount implements protocol.Account.AsAccount(). diff --git a/proxy/vless/account.pb.go b/proxy/vless/account.pb.go index ff629e612..17029cbeb 100644 --- a/proxy/vless/account.pb.go +++ b/proxy/vless/account.pb.go @@ -101,13 +101,13 @@ var file_proxy_vless_account_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x55, 0x0a, 0x14, + 0x52, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x52, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, - 0x6c, 0x65, 0x73, 0x73, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6c, 0x65, 0x73, 0x73, 0x50, 0x01, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, - 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, 0x73, - 0xaa, 0x02, 0x10, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6c, - 0x65, 0x73, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, 0x73, 0xaa, 0x02, 0x10, + 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6c, 0x65, 0x73, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/vless/account.proto b/proxy/vless/account.proto index 298bdfdad..38bd61448 100644 --- a/proxy/vless/account.proto +++ b/proxy/vless/account.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.vless; option csharp_namespace = "Xray.Proxy.Vless"; -option go_package = "github.com/xtls/xray-core/v1/proxy/vless"; +option go_package = "github.com/xtls/xray-core/proxy/vless"; option java_package = "com.xray.proxy.vless"; option java_multiple_files = true; diff --git a/proxy/vless/encoding/addons.go b/proxy/vless/encoding/addons.go index c0ee0b026..cc4a7865b 100644 --- a/proxy/vless/encoding/addons.go +++ b/proxy/vless/encoding/addons.go @@ -7,9 +7,9 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/proxy/vless" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/proxy/vless" ) func EncodeHeaderAddons(buffer *buf.Buffer, addons *Addons) error { diff --git a/proxy/vless/encoding/addons.pb.go b/proxy/vless/encoding/addons.pb.go index 86429d5e2..97c905217 100644 --- a/proxy/vless/encoding/addons.pb.go +++ b/proxy/vless/encoding/addons.pb.go @@ -84,20 +84,19 @@ func init() { func init() { proto.RegisterFile("proxy/vless/encoding/addons.proto", fileDescriptor_75ab671b0ca8b1cc) } var fileDescriptor_75ab671b0ca8b1cc = []byte{ - // 195 bytes of a gzipped FileDescriptorProto + // 191 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0x28, 0xca, 0xaf, 0xa8, 0xd4, 0x2f, 0xcb, 0x49, 0x2d, 0x2e, 0xd6, 0x4f, 0xcd, 0x4b, 0xce, 0x4f, 0xc9, 0xcc, 0x4b, 0xd7, 0x4f, 0x4c, 0x49, 0xc9, 0xcf, 0x2b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0xac, 0x28, 0x4a, 0xac, 0xd4, 0x03, 0xab, 0xd3, 0x03, 0xab, 0xd3, 0x83, 0xa9, 0x53, 0x32, 0xe0, 0x62, 0x73, 0x04, 0x2b, 0x15, 0x12, 0xe2, 0x62, 0x71, 0xcb, 0xc9, 0x2f, 0x97, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x41, 0x62, 0xc1, 0xa9, 0xa9, 0x29, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x3c, - 0x41, 0x60, 0xb6, 0x53, 0x03, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, - 0x24, 0xc7, 0x38, 0xe3, 0xb1, 0x1c, 0x03, 0x97, 0x6c, 0x72, 0x7e, 0xae, 0x1e, 0x4e, 0x3b, 0x02, - 0x18, 0xa3, 0x0c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x2b, 0x4a, - 0x72, 0x8a, 0xf5, 0x41, 0x8a, 0x75, 0x93, 0xf3, 0x8b, 0x52, 0xf5, 0xcb, 0x0c, 0xf5, 0xb1, 0x79, - 0x60, 0x15, 0x93, 0x64, 0x04, 0xc8, 0xc0, 0x00, 0xb0, 0x81, 0x61, 0x60, 0x03, 0x5d, 0xa1, 0x72, - 0x49, 0x6c, 0x60, 0x6f, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xda, 0x20, 0x32, 0x3e, 0xfb, - 0x00, 0x00, 0x00, + 0x41, 0x60, 0xb6, 0x53, 0xed, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, + 0xc7, 0x38, 0xe3, 0xb1, 0x1c, 0x03, 0x97, 0x6c, 0x72, 0x7e, 0xae, 0x1e, 0x4e, 0x2b, 0x02, 0x18, + 0xa3, 0xf4, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x2b, 0x4a, 0x72, + 0x8a, 0xf5, 0x41, 0x8a, 0x75, 0x93, 0xf3, 0x8b, 0x52, 0xf5, 0xb1, 0x39, 0x7e, 0x15, 0x93, 0x64, + 0x04, 0xc8, 0xb4, 0x00, 0xb0, 0x69, 0x61, 0x60, 0xd3, 0x5c, 0xa1, 0x72, 0x49, 0x6c, 0x60, 0x2f, + 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x32, 0xfc, 0x98, 0x28, 0xf7, 0x00, 0x00, 0x00, } func (m *Addons) Marshal() (dAtA []byte, err error) { diff --git a/proxy/vless/encoding/addons.proto b/proxy/vless/encoding/addons.proto index b913a53fe..3730e87fd 100644 --- a/proxy/vless/encoding/addons.proto +++ b/proxy/vless/encoding/addons.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.vless.encoding; option csharp_namespace = "Xray.Proxy.Vless.Encoding"; -option go_package = "github.com/xtls/xray-core/v1/proxy/vless/encoding"; +option go_package = "github.com/xtls/xray-core/proxy/vless/encoding"; option java_package = "com.xray.proxy.vless.encoding"; option java_multiple_files = true; diff --git a/proxy/vless/encoding/encoding.go b/proxy/vless/encoding/encoding.go index 7f24c1c20..04b849556 100644 --- a/proxy/vless/encoding/encoding.go +++ b/proxy/vless/encoding/encoding.go @@ -2,21 +2,25 @@ package encoding -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( + "context" "fmt" "io" "syscall" + "time" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/proxy/vless" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/proxy/vless" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/xtls" ) const ( @@ -174,12 +178,39 @@ func DecodeResponseHeader(reader io.Reader, request *protocol.RequestHeader) (*A return responseAddons, nil } -func ReadV(reader buf.Reader, writer buf.Writer, timer signal.ActivityUpdater, conn *xtls.Conn, rawConn syscall.RawConn, counter stats.Counter) error { +func ReadV(reader buf.Reader, writer buf.Writer, timer signal.ActivityUpdater, conn *xtls.Conn, rawConn syscall.RawConn, counter stats.Counter, sctx context.Context) error { err := func() error { var ct stats.Counter for { if conn.DirectIn { conn.DirectIn = false + if sctx != nil { + if inbound := session.InboundFromContext(sctx); inbound != nil { + iConn := inbound.Conn + statConn, ok := iConn.(*internet.StatCouterConnection) + if ok { + iConn = statConn.Connection + } + if tc, ok := iConn.(*net.TCPConn); ok { + if conn.SHOW { + fmt.Println(conn.MARK, "Splice") + } + time.Sleep(time.Millisecond) // necessary + w, err := tc.ReadFrom(conn.Connection) + if counter != nil { + counter.Add(w) + } + if statConn != nil && statConn.WriteCounter != nil { + statConn.WriteCounter.Add(w) + } + return err + } else { + panic("XTLS Splice: not TCP inbound") + } + } else { + panic("XTLS Splice: nil inbound") + } + } reader = buf.NewReadVReader(conn.Connection, rawConn) ct = counter if conn.SHOW { diff --git a/proxy/vless/encoding/encoding_test.go b/proxy/vless/encoding/encoding_test.go index 5e5e2812a..b8bfa73cb 100644 --- a/proxy/vless/encoding/encoding_test.go +++ b/proxy/vless/encoding/encoding_test.go @@ -5,13 +5,13 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/proxy/vless" - . "github.com/xtls/xray-core/v1/proxy/vless/encoding" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/proxy/vless" + . "github.com/xtls/xray-core/proxy/vless/encoding" ) func toAccount(a *vless.Account) protocol.Account { diff --git a/proxy/vless/encoding/errors.generated.go b/proxy/vless/encoding/errors.generated.go index b12e7eceb..267711d94 100644 --- a/proxy/vless/encoding/errors.generated.go +++ b/proxy/vless/encoding/errors.generated.go @@ -1,6 +1,6 @@ package encoding -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vless/errors.generated.go b/proxy/vless/errors.generated.go index 533d8cb82..9487ff0e6 100644 --- a/proxy/vless/errors.generated.go +++ b/proxy/vless/errors.generated.go @@ -1,6 +1,6 @@ package vless -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vless/inbound/config.pb.go b/proxy/vless/inbound/config.pb.go index 35527fad6..a2be91a24 100644 --- a/proxy/vless/inbound/config.pb.go +++ b/proxy/vless/inbound/config.pb.go @@ -8,7 +8,7 @@ package inbound import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -195,15 +195,14 @@ var file_proxy_vless_inbound_config_proto_rawDesc = []byte{ 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x46, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, - 0x52, 0x09, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x42, 0x6d, 0x0a, 0x1c, 0x63, + 0x52, 0x09, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x42, 0x6a, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6c, - 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x30, 0x67, + 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, - 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0xaa, - 0x02, 0x18, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6c, 0x65, - 0x73, 0x73, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, + 0x6c, 0x65, 0x73, 0x73, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0xaa, 0x02, 0x18, 0x58, + 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6c, 0x65, 0x73, 0x73, 0x2e, + 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/vless/inbound/config.proto b/proxy/vless/inbound/config.proto index 664e0f09c..ee24161f6 100644 --- a/proxy/vless/inbound/config.proto +++ b/proxy/vless/inbound/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.vless.inbound; option csharp_namespace = "Xray.Proxy.Vless.Inbound"; -option go_package = "github.com/xtls/xray-core/v1/proxy/vless/inbound"; +option go_package = "github.com/xtls/xray-core/proxy/vless/inbound"; option java_package = "com.xray.proxy.vless.inbound"; option java_multiple_files = true; diff --git a/proxy/vless/inbound/errors.generated.go b/proxy/vless/inbound/errors.generated.go index f1f4116fe..c2d7295e4 100644 --- a/proxy/vless/inbound/errors.generated.go +++ b/proxy/vless/inbound/errors.generated.go @@ -1,6 +1,6 @@ package inbound -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vless/inbound/inbound.go b/proxy/vless/inbound/inbound.go index 00df133c4..16ab7cd3e 100644 --- a/proxy/vless/inbound/inbound.go +++ b/proxy/vless/inbound/inbound.go @@ -2,7 +2,7 @@ package inbound -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" @@ -11,28 +11,28 @@ import ( "syscall" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/dns" - feature_inbound "github.com/xtls/xray-core/v1/features/inbound" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/proxy/vless" - "github.com/xtls/xray-core/v1/proxy/vless/encoding" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/dns" + feature_inbound "github.com/xtls/xray-core/features/inbound" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/proxy/vless" + "github.com/xtls/xray-core/proxy/vless/encoding" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/xtls" ) var ( @@ -445,7 +445,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i if statConn != nil { counter = statConn.ReadCounter } - err = encoding.ReadV(clientReader, serverWriter, timer, iConn.(*xtls.Conn), rawConn, counter) + err = encoding.ReadV(clientReader, serverWriter, timer, iConn.(*xtls.Conn), rawConn, counter, nil) } else { // from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBufer err = buf.Copy(clientReader, serverWriter, buf.UpdateActivity(timer)) diff --git a/proxy/vless/outbound/config.pb.go b/proxy/vless/outbound/config.pb.go index fc9681778..b39657ffc 100644 --- a/proxy/vless/outbound/config.pb.go +++ b/proxy/vless/outbound/config.pb.go @@ -8,7 +8,7 @@ package outbound import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -86,15 +86,14 @@ var file_proxy_vless_outbound_config_proto_rawDesc = []byte{ 0x6e, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x52, 0x05, 0x76, 0x6e, 0x65, 0x78, 0x74, 0x42, 0x70, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, + 0x52, 0x05, 0x76, 0x6e, 0x65, 0x78, 0x74, 0x42, 0x6d, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2e, - 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, + 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, - 0x6c, 0x65, 0x73, 0x73, 0x2f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0xaa, 0x02, 0x19, - 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6c, 0x65, 0x73, 0x73, - 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, + 0x73, 0x2f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0xaa, 0x02, 0x19, 0x58, 0x72, 0x61, + 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6c, 0x65, 0x73, 0x73, 0x2e, 0x4f, 0x75, + 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/vless/outbound/config.proto b/proxy/vless/outbound/config.proto index a7a8d0e18..55455cbfd 100644 --- a/proxy/vless/outbound/config.proto +++ b/proxy/vless/outbound/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.vless.outbound; option csharp_namespace = "Xray.Proxy.Vless.Outbound"; -option go_package = "github.com/xtls/xray-core/v1/proxy/vless/outbound"; +option go_package = "github.com/xtls/xray-core/proxy/vless/outbound"; option java_package = "com.xray.proxy.vless.outbound"; option java_multiple_files = true; diff --git a/proxy/vless/outbound/errors.generated.go b/proxy/vless/outbound/errors.generated.go index b6bfdd868..079668236 100644 --- a/proxy/vless/outbound/errors.generated.go +++ b/proxy/vless/outbound/errors.generated.go @@ -1,6 +1,6 @@ package outbound -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vless/outbound/outbound.go b/proxy/vless/outbound/outbound.go index 937a44cca..84c5e199a 100644 --- a/proxy/vless/outbound/outbound.go +++ b/proxy/vless/outbound/outbound.go @@ -2,30 +2,30 @@ package outbound -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "syscall" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/proxy/vless" - "github.com/xtls/xray-core/v1/proxy/vless/encoding" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/proxy/vless" + "github.com/xtls/xray-core/proxy/vless/encoding" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/xtls" ) var ( @@ -128,14 +128,15 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte } var rawConn syscall.RawConn + var sctx context.Context allowUDP443 := false switch requestAddons.Flow { - case vless.XRO + "-udp443", vless.XRD + "-udp443": + case vless.XRO + "-udp443", vless.XRD + "-udp443", vless.XRS + "-udp443": allowUDP443 = true requestAddons.Flow = requestAddons.Flow[:16] fallthrough - case vless.XRO, vless.XRD: + case vless.XRO, vless.XRD, vless.XRS: switch request.Command { case protocol.RequestCommandMux: return newError(requestAddons.Flow + " doesn't support Mux").AtWarning() @@ -149,6 +150,10 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte xtlsConn.RPRX = true xtlsConn.SHOW = xtls_show xtlsConn.MARK = "XTLS" + if requestAddons.Flow == vless.XRS { + sctx = ctx + requestAddons.Flow = vless.XRD + } if requestAddons.Flow == vless.XRD { xtlsConn.DirectMode = true if sc, ok := xtlsConn.Connection.(syscall.Conn); ok { @@ -219,7 +224,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte if statConn != nil { counter = statConn.ReadCounter } - err = encoding.ReadV(serverReader, clientWriter, timer, iConn.(*xtls.Conn), rawConn, counter) + err = encoding.ReadV(serverReader, clientWriter, timer, iConn.(*xtls.Conn), rawConn, counter, sctx) } else { // from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBufer err = buf.Copy(serverReader, clientWriter, buf.UpdateActivity(timer)) diff --git a/proxy/vless/validator.go b/proxy/vless/validator.go index 41566fe32..663ba49fe 100644 --- a/proxy/vless/validator.go +++ b/proxy/vless/validator.go @@ -6,8 +6,8 @@ import ( "strings" "sync" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" ) // Validator stores valid VLESS users. diff --git a/proxy/vless/vless.go b/proxy/vless/vless.go index f4026804b..a9e847ec1 100644 --- a/proxy/vless/vless.go +++ b/proxy/vless/vless.go @@ -5,9 +5,10 @@ // clients with 'socks' for proxying. package vless -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen const ( XRO = "xtls-rprx-origin" XRD = "xtls-rprx-direct" + XRS = "xtls-rprx-splice" ) diff --git a/proxy/vmess/account.go b/proxy/vmess/account.go index a9917e4cf..eaf104bcf 100644 --- a/proxy/vmess/account.go +++ b/proxy/vmess/account.go @@ -3,9 +3,9 @@ package vmess import ( - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" ) // MemoryAccount is an in-memory form of VMess account. diff --git a/proxy/vmess/account.pb.go b/proxy/vmess/account.pb.go index 0772f339f..74339fe61 100644 --- a/proxy/vmess/account.pb.go +++ b/proxy/vmess/account.pb.go @@ -8,7 +8,7 @@ package vmess import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -120,13 +120,13 @@ var file_proxy_vmess_account_proto_rawDesc = []byte{ 0x6e, 0x66, 0x69, 0x67, 0x52, 0x10, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, - 0x65, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x55, 0x0a, 0x14, 0x63, + 0x65, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x52, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6d, - 0x65, 0x73, 0x73, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x65, 0x73, 0x73, 0x50, 0x01, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0xaa, - 0x02, 0x10, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6d, 0x65, - 0x73, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0xaa, 0x02, 0x10, 0x58, + 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6d, 0x65, 0x73, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/vmess/account.proto b/proxy/vmess/account.proto index 1572d268a..98dc681ea 100644 --- a/proxy/vmess/account.proto +++ b/proxy/vmess/account.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.vmess; option csharp_namespace = "Xray.Proxy.Vmess"; -option go_package = "github.com/xtls/xray-core/v1/proxy/vmess"; +option go_package = "github.com/xtls/xray-core/proxy/vmess"; option java_package = "com.xray.proxy.vmess"; option java_multiple_files = true; diff --git a/proxy/vmess/aead/authid.go b/proxy/vmess/aead/authid.go index c744a8ce5..2ec48f110 100644 --- a/proxy/vmess/aead/authid.go +++ b/proxy/vmess/aead/authid.go @@ -12,8 +12,8 @@ import ( "math" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/antireplay" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/antireplay" ) var ( diff --git a/proxy/vmess/aead/encrypt.go b/proxy/vmess/aead/encrypt.go index bcdf922d2..bd7df0ec5 100644 --- a/proxy/vmess/aead/encrypt.go +++ b/proxy/vmess/aead/encrypt.go @@ -9,7 +9,7 @@ import ( "io" "time" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) func SealVMessAEADHeader(key [16]byte, data []byte) []byte { diff --git a/proxy/vmess/encoding/auth.go b/proxy/vmess/encoding/auth.go index a6e3dc2f8..1761238c4 100644 --- a/proxy/vmess/encoding/auth.go +++ b/proxy/vmess/encoding/auth.go @@ -5,7 +5,7 @@ import ( "encoding/binary" "hash/fnv" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" "golang.org/x/crypto/sha3" ) diff --git a/proxy/vmess/encoding/auth_test.go b/proxy/vmess/encoding/auth_test.go index b841901c6..87e414c15 100644 --- a/proxy/vmess/encoding/auth_test.go +++ b/proxy/vmess/encoding/auth_test.go @@ -6,8 +6,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/proxy/vmess/encoding" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/proxy/vmess/encoding" ) func TestFnvAuth(t *testing.T) { diff --git a/proxy/vmess/encoding/client.go b/proxy/vmess/encoding/client.go index b9161c78b..d46e8fb67 100644 --- a/proxy/vmess/encoding/client.go +++ b/proxy/vmess/encoding/client.go @@ -15,15 +15,15 @@ import ( "golang.org/x/crypto/chacha20poly1305" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/bitmask" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/crypto" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/vmess" - vmessaead "github.com/xtls/xray-core/v1/proxy/vmess/aead" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/bitmask" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/vmess" + vmessaead "github.com/xtls/xray-core/proxy/vmess/aead" ) func hashTimestamp(h hash.Hash, t protocol.Timestamp) []byte { diff --git a/proxy/vmess/encoding/commands.go b/proxy/vmess/encoding/commands.go index 305b7fb2d..c71d6460a 100644 --- a/proxy/vmess/encoding/commands.go +++ b/proxy/vmess/encoding/commands.go @@ -4,12 +4,12 @@ import ( "encoding/binary" "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" ) var ( diff --git a/proxy/vmess/encoding/commands_test.go b/proxy/vmess/encoding/commands_test.go index b29de3c03..12acfba45 100644 --- a/proxy/vmess/encoding/commands_test.go +++ b/proxy/vmess/encoding/commands_test.go @@ -5,11 +5,11 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" - . "github.com/xtls/xray-core/v1/proxy/vmess/encoding" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" + . "github.com/xtls/xray-core/proxy/vmess/encoding" ) func TestSwitchAccount(t *testing.T) { diff --git a/proxy/vmess/encoding/encoding.go b/proxy/vmess/encoding/encoding.go index f69ec74fa..6a93dd124 100644 --- a/proxy/vmess/encoding/encoding.go +++ b/proxy/vmess/encoding/encoding.go @@ -1,11 +1,11 @@ package encoding import ( - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" ) -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen const ( Version = byte(1) diff --git a/proxy/vmess/encoding/encoding_test.go b/proxy/vmess/encoding/encoding_test.go index 5dd9ed5df..c136731e5 100644 --- a/proxy/vmess/encoding/encoding_test.go +++ b/proxy/vmess/encoding/encoding_test.go @@ -6,13 +6,13 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/proxy/vmess" - . "github.com/xtls/xray-core/v1/proxy/vmess/encoding" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/proxy/vmess" + . "github.com/xtls/xray-core/proxy/vmess/encoding" ) func toAccount(a *vmess.Account) protocol.Account { diff --git a/proxy/vmess/encoding/errors.generated.go b/proxy/vmess/encoding/errors.generated.go index b12e7eceb..267711d94 100644 --- a/proxy/vmess/encoding/errors.generated.go +++ b/proxy/vmess/encoding/errors.generated.go @@ -1,6 +1,6 @@ package encoding -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vmess/encoding/server.go b/proxy/vmess/encoding/server.go index b4995908c..9951919f4 100644 --- a/proxy/vmess/encoding/server.go +++ b/proxy/vmess/encoding/server.go @@ -13,16 +13,16 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/bitmask" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/crypto" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/proxy/vmess" - vmessaead "github.com/xtls/xray-core/v1/proxy/vmess/aead" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/bitmask" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/proxy/vmess" + vmessaead "github.com/xtls/xray-core/proxy/vmess/aead" "golang.org/x/crypto/chacha20poly1305" ) diff --git a/proxy/vmess/errors.generated.go b/proxy/vmess/errors.generated.go index bf5f70dab..29d69d743 100644 --- a/proxy/vmess/errors.generated.go +++ b/proxy/vmess/errors.generated.go @@ -1,6 +1,6 @@ package vmess -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vmess/inbound/config.pb.go b/proxy/vmess/inbound/config.pb.go index 36fa16602..b1a52ac41 100644 --- a/proxy/vmess/inbound/config.pb.go +++ b/proxy/vmess/inbound/config.pb.go @@ -8,7 +8,7 @@ package inbound import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -228,15 +228,15 @@ var file_proxy_vmess_inbound_config_proto_rawDesc = []byte{ 0x52, 0x06, 0x64, 0x65, 0x74, 0x6f, 0x75, 0x72, 0x12, 0x34, 0x0a, 0x16, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, - 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x6e, 0x6c, 0x79, 0x42, 0x6d, + 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x6e, 0x6c, 0x79, 0x42, 0x6a, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, - 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, - 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x75, - 0x6e, 0x64, 0xaa, 0x02, 0x18, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x56, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, + 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0xaa, + 0x02, 0x18, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6d, 0x65, + 0x73, 0x73, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/proxy/vmess/inbound/config.proto b/proxy/vmess/inbound/config.proto index 0d9014243..9fc7e36f6 100644 --- a/proxy/vmess/inbound/config.proto +++ b/proxy/vmess/inbound/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.vmess.inbound; option csharp_namespace = "Xray.Proxy.Vmess.Inbound"; -option go_package = "github.com/xtls/xray-core/v1/proxy/vmess/inbound"; +option go_package = "github.com/xtls/xray-core/proxy/vmess/inbound"; option java_package = "com.xray.proxy.vmess.inbound"; option java_multiple_files = true; diff --git a/proxy/vmess/inbound/errors.generated.go b/proxy/vmess/inbound/errors.generated.go index f1f4116fe..c2d7295e4 100644 --- a/proxy/vmess/inbound/errors.generated.go +++ b/proxy/vmess/inbound/errors.generated.go @@ -1,6 +1,6 @@ package inbound -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vmess/inbound/inbound.go b/proxy/vmess/inbound/inbound.go index 182def61c..af362e189 100644 --- a/proxy/vmess/inbound/inbound.go +++ b/proxy/vmess/inbound/inbound.go @@ -2,7 +2,7 @@ package inbound -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" @@ -11,23 +11,23 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/core" - feature_inbound "github.com/xtls/xray-core/v1/features/inbound" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/encoding" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/core" + feature_inbound "github.com/xtls/xray-core/features/inbound" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/encoding" + "github.com/xtls/xray-core/transport/internet" ) type userByEmail struct { diff --git a/proxy/vmess/outbound/command.go b/proxy/vmess/outbound/command.go index bd45cfcdd..19a7877b9 100644 --- a/proxy/vmess/outbound/command.go +++ b/proxy/vmess/outbound/command.go @@ -5,10 +5,10 @@ package outbound import ( "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/proxy/vmess" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/proxy/vmess" ) func (h *Handler) handleSwitchAccount(cmd *protocol.CommandSwitchAccount) { diff --git a/proxy/vmess/outbound/config.pb.go b/proxy/vmess/outbound/config.pb.go index 1812818d2..7a6783bbc 100644 --- a/proxy/vmess/outbound/config.pb.go +++ b/proxy/vmess/outbound/config.pb.go @@ -8,7 +8,7 @@ package outbound import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -86,15 +86,15 @@ var file_proxy_vmess_outbound_config_proto_rawDesc = []byte{ 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x52, 0x08, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x42, 0x70, 0x0a, + 0x69, 0x6e, 0x74, 0x52, 0x08, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x42, 0x6d, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, - 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, - 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2f, 0x6f, 0x75, 0x74, 0x62, 0x6f, - 0x75, 0x6e, 0x64, 0xaa, 0x02, 0x19, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, - 0x2e, 0x56, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, + 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, + 0xaa, 0x02, 0x19, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6d, + 0x65, 0x73, 0x73, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/vmess/outbound/config.proto b/proxy/vmess/outbound/config.proto index 0ac0f410e..2a8271581 100644 --- a/proxy/vmess/outbound/config.proto +++ b/proxy/vmess/outbound/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.vmess.outbound; option csharp_namespace = "Xray.Proxy.Vmess.Outbound"; -option go_package = "github.com/xtls/xray-core/v1/proxy/vmess/outbound"; +option go_package = "github.com/xtls/xray-core/proxy/vmess/outbound"; option java_package = "com.xray.proxy.vmess.outbound"; option java_multiple_files = true; diff --git a/proxy/vmess/outbound/errors.generated.go b/proxy/vmess/outbound/errors.generated.go index b6bfdd868..079668236 100644 --- a/proxy/vmess/outbound/errors.generated.go +++ b/proxy/vmess/outbound/errors.generated.go @@ -1,6 +1,6 @@ package outbound -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vmess/outbound/outbound.go b/proxy/vmess/outbound/outbound.go index 148f85eac..56ef49937 100644 --- a/proxy/vmess/outbound/outbound.go +++ b/proxy/vmess/outbound/outbound.go @@ -2,27 +2,27 @@ package outbound -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/encoding" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/encoding" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) // Handler is an outbound connection handler for VMess protocol. diff --git a/proxy/vmess/validator.go b/proxy/vmess/validator.go index c1cc256fa..86089de24 100644 --- a/proxy/vmess/validator.go +++ b/proxy/vmess/validator.go @@ -11,12 +11,12 @@ import ( "sync/atomic" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/proxy/vmess/aead" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/proxy/vmess/aead" ) const ( diff --git a/proxy/vmess/validator_test.go b/proxy/vmess/validator_test.go index 0a22ea319..634b4e23e 100644 --- a/proxy/vmess/validator_test.go +++ b/proxy/vmess/validator_test.go @@ -4,11 +4,11 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - . "github.com/xtls/xray-core/v1/proxy/vmess" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + . "github.com/xtls/xray-core/proxy/vmess" ) func toAccount(a *Account) protocol.Account { diff --git a/proxy/vmess/vmess.go b/proxy/vmess/vmess.go index d58abca7d..836b1889e 100644 --- a/proxy/vmess/vmess.go +++ b/proxy/vmess/vmess.go @@ -5,4 +5,4 @@ // clients with 'socks' for proxying. package vmess -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/testing/mocks/dns.go b/testing/mocks/dns.go index 8b1776df5..982671070 100644 --- a/testing/mocks/dns.go +++ b/testing/mocks/dns.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/xtls/xray-core/v1/features/dns (interfaces: Client) +// Source: github.com/xtls/xray-core/features/dns (interfaces: Client) // Package mocks is a generated GoMock package. package mocks diff --git a/testing/mocks/log.go b/testing/mocks/log.go index 94bab43e7..77c821f5b 100644 --- a/testing/mocks/log.go +++ b/testing/mocks/log.go @@ -1,12 +1,12 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/xtls/xray-core/v1/common/log (interfaces: Handler) +// Source: github.com/xtls/xray-core/common/log (interfaces: Handler) // Package mocks is a generated GoMock package. package mocks import ( gomock "github.com/golang/mock/gomock" - log "github.com/xtls/xray-core/v1/common/log" + log "github.com/xtls/xray-core/common/log" reflect "reflect" ) diff --git a/testing/mocks/mux.go b/testing/mocks/mux.go index 18464dbae..07d4c4ada 100644 --- a/testing/mocks/mux.go +++ b/testing/mocks/mux.go @@ -1,12 +1,12 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/xtls/xray-core/v1/common/mux (interfaces: ClientWorkerFactory) +// Source: github.com/xtls/xray-core/common/mux (interfaces: ClientWorkerFactory) // Package mocks is a generated GoMock package. package mocks import ( gomock "github.com/golang/mock/gomock" - mux "github.com/xtls/xray-core/v1/common/mux" + mux "github.com/xtls/xray-core/common/mux" reflect "reflect" ) diff --git a/testing/mocks/outbound.go b/testing/mocks/outbound.go index fd370c296..9cab8c34d 100644 --- a/testing/mocks/outbound.go +++ b/testing/mocks/outbound.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/xtls/xray-core/v1/features/outbound (interfaces: Manager,HandlerSelector) +// Source: github.com/xtls/xray-core/features/outbound (interfaces: Manager,HandlerSelector) // Package mocks is a generated GoMock package. package mocks @@ -7,7 +7,7 @@ package mocks import ( context "context" gomock "github.com/golang/mock/gomock" - outbound "github.com/xtls/xray-core/v1/features/outbound" + outbound "github.com/xtls/xray-core/features/outbound" reflect "reflect" ) diff --git a/testing/mocks/proxy.go b/testing/mocks/proxy.go index e8a1fe35b..cba5b3cac 100644 --- a/testing/mocks/proxy.go +++ b/testing/mocks/proxy.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/xtls/xray-core/v1/proxy (interfaces: Inbound,Outbound) +// Source: github.com/xtls/xray-core/proxy (interfaces: Inbound,Outbound) // Package mocks is a generated GoMock package. package mocks @@ -7,10 +7,10 @@ package mocks import ( context "context" gomock "github.com/golang/mock/gomock" - net "github.com/xtls/xray-core/v1/common/net" - routing "github.com/xtls/xray-core/v1/features/routing" - transport "github.com/xtls/xray-core/v1/transport" - internet "github.com/xtls/xray-core/v1/transport/internet" + net "github.com/xtls/xray-core/common/net" + routing "github.com/xtls/xray-core/features/routing" + transport "github.com/xtls/xray-core/transport" + internet "github.com/xtls/xray-core/transport/internet" reflect "reflect" ) diff --git a/testing/scenarios/command_test.go b/testing/scenarios/command_test.go index cd7dc0c84..7e5f1ef82 100644 --- a/testing/scenarios/command_test.go +++ b/testing/scenarios/command_test.go @@ -12,25 +12,25 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "google.golang.org/grpc" - "github.com/xtls/xray-core/v1/app/commander" - "github.com/xtls/xray-core/v1/app/policy" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/app/proxyman/command" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/app/stats" - statscmd "github.com/xtls/xray-core/v1/app/stats/command" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + "github.com/xtls/xray-core/app/commander" + "github.com/xtls/xray-core/app/policy" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/app/proxyman/command" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/app/stats" + statscmd "github.com/xtls/xray-core/app/stats/command" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" ) func TestCommanderRemoveHandler(t *testing.T) { diff --git a/testing/scenarios/common.go b/testing/scenarios/common.go index 364e376bd..2a7cbfd0c 100644 --- a/testing/scenarios/common.go +++ b/testing/scenarios/common.go @@ -14,15 +14,15 @@ import ( "time" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/serial" - core "github.com/xtls/xray-core/v1/core" + "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/serial" + core "github.com/xtls/xray-core/core" ) func xor(b []byte) []byte { diff --git a/testing/scenarios/common_coverage.go b/testing/scenarios/common_coverage.go index 0082097d6..aa4b79687 100644 --- a/testing/scenarios/common_coverage.go +++ b/testing/scenarios/common_coverage.go @@ -7,7 +7,7 @@ import ( "os" "os/exec" - "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common/uuid" ) func BuildXray() error { @@ -16,7 +16,7 @@ func BuildXray() error { return nil } - cmd := exec.Command("go", "test", "-tags", "coverage coveragemain", "-coverpkg", "github.com/xtls/xray-core/v1/...", "-c", "-o", testBinaryPath, GetSourcePath()) + cmd := exec.Command("go", "test", "-tags", "coverage coveragemain", "-coverpkg", "github.com/xtls/xray-core/...", "-c", "-o", testBinaryPath, GetSourcePath()) return cmd.Run() } diff --git a/testing/scenarios/dns_test.go b/testing/scenarios/dns_test.go index 1b289bc9c..886068d76 100644 --- a/testing/scenarios/dns_test.go +++ b/testing/scenarios/dns_test.go @@ -5,17 +5,17 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/app/dns" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/blackhole" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/socks" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + "github.com/xtls/xray-core/app/dns" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/blackhole" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/socks" + "github.com/xtls/xray-core/testing/servers/tcp" xproxy "golang.org/x/net/proxy" ) diff --git a/testing/scenarios/dokodemo_test.go b/testing/scenarios/dokodemo_test.go index 7a73ee5e6..ac8dda90b 100644 --- a/testing/scenarios/dokodemo_test.go +++ b/testing/scenarios/dokodemo_test.go @@ -6,22 +6,22 @@ import ( "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" ) func TestDokodemoTCP(t *testing.T) { diff --git a/testing/scenarios/feature_test.go b/testing/scenarios/feature_test.go index d49bb689b..3977606da 100644 --- a/testing/scenarios/feature_test.go +++ b/testing/scenarios/feature_test.go @@ -8,30 +8,30 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/proxyman" - _ "github.com/xtls/xray-core/v1/app/proxyman/inbound" - _ "github.com/xtls/xray-core/v1/app/proxyman/outbound" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/blackhole" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - v2http "github.com/xtls/xray-core/v1/proxy/http" - "github.com/xtls/xray-core/v1/proxy/socks" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/proxyman" + _ "github.com/xtls/xray-core/app/proxyman/inbound" + _ "github.com/xtls/xray-core/app/proxyman/outbound" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/blackhole" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + v2http "github.com/xtls/xray-core/proxy/http" + "github.com/xtls/xray-core/proxy/socks" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" + "github.com/xtls/xray-core/transport/internet" xproxy "golang.org/x/net/proxy" ) diff --git a/testing/scenarios/http_test.go b/testing/scenarios/http_test.go index d89b31b8b..4ab8b8120 100644 --- a/testing/scenarios/http_test.go +++ b/testing/scenarios/http_test.go @@ -13,16 +13,16 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/freedom" - v2http "github.com/xtls/xray-core/v1/proxy/http" - v2httptest "github.com/xtls/xray-core/v1/testing/servers/http" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/freedom" + v2http "github.com/xtls/xray-core/proxy/http" + v2httptest "github.com/xtls/xray-core/testing/servers/http" + "github.com/xtls/xray-core/testing/servers/tcp" ) func TestHttpConformance(t *testing.T) { diff --git a/testing/scenarios/policy_test.go b/testing/scenarios/policy_test.go index dcf807d82..de7443897 100644 --- a/testing/scenarios/policy_test.go +++ b/testing/scenarios/policy_test.go @@ -7,22 +7,22 @@ import ( "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/policy" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/policy" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" ) func startQuickClosingTCPServer() (net.Listener, error) { diff --git a/testing/scenarios/reverse_test.go b/testing/scenarios/reverse_test.go index 50f227333..cbe9abdf6 100644 --- a/testing/scenarios/reverse_test.go +++ b/testing/scenarios/reverse_test.go @@ -6,25 +6,25 @@ import ( "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/policy" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/app/reverse" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/blackhole" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/policy" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/app/reverse" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/blackhole" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" ) func TestReverseProxy(t *testing.T) { diff --git a/testing/scenarios/shadowsocks_test.go b/testing/scenarios/shadowsocks_test.go index db2f0b23d..de842afc5 100644 --- a/testing/scenarios/shadowsocks_test.go +++ b/testing/scenarios/shadowsocks_test.go @@ -8,20 +8,20 @@ import ( "github.com/google/go-cmp/cmp" "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/shadowsocks" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/shadowsocks" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" ) func TestShadowsocksAES256TCP(t *testing.T) { diff --git a/testing/scenarios/socks_test.go b/testing/scenarios/socks_test.go index 913291d2d..72da1d84d 100644 --- a/testing/scenarios/socks_test.go +++ b/testing/scenarios/socks_test.go @@ -7,19 +7,19 @@ import ( xproxy "golang.org/x/net/proxy" socks4 "h12.io/socks" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/blackhole" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/socks" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/blackhole" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/socks" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" ) func TestSocksBridgeTCP(t *testing.T) { diff --git a/testing/scenarios/tls_test.go b/testing/scenarios/tls_test.go index d2531c1f7..c81e51222 100644 --- a/testing/scenarios/tls_test.go +++ b/testing/scenarios/tls_test.go @@ -8,25 +8,25 @@ import ( "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/http" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/websocket" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/http" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/websocket" ) func TestSimpleTLSConnection(t *testing.T) { diff --git a/testing/scenarios/transport_test.go b/testing/scenarios/transport_test.go index b46a4f658..5ffd4569a 100644 --- a/testing/scenarios/transport_test.go +++ b/testing/scenarios/transport_test.go @@ -8,27 +8,27 @@ import ( "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/domainsocket" - "github.com/xtls/xray-core/v1/transport/internet/headers/http" - "github.com/xtls/xray-core/v1/transport/internet/headers/wechat" - "github.com/xtls/xray-core/v1/transport/internet/quic" - tcptransport "github.com/xtls/xray-core/v1/transport/internet/tcp" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/domainsocket" + "github.com/xtls/xray-core/transport/internet/headers/http" + "github.com/xtls/xray-core/transport/internet/headers/wechat" + "github.com/xtls/xray-core/transport/internet/quic" + tcptransport "github.com/xtls/xray-core/transport/internet/tcp" ) func TestHTTPConnectionHeader(t *testing.T) { diff --git a/testing/scenarios/vmess_test.go b/testing/scenarios/vmess_test.go index 4c1772dc0..0bec333c9 100644 --- a/testing/scenarios/vmess_test.go +++ b/testing/scenarios/vmess_test.go @@ -5,24 +5,24 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/kcp" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/kcp" "golang.org/x/sync/errgroup" ) diff --git a/testing/servers/http/http.go b/testing/servers/http/http.go index 8d76809ed..dabd6a2a3 100644 --- a/testing/servers/http/http.go +++ b/testing/servers/http/http.go @@ -3,7 +3,7 @@ package tcp import ( "net/http" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) type Server struct { diff --git a/testing/servers/tcp/port.go b/testing/servers/tcp/port.go index fe99ad24f..67f85c876 100644 --- a/testing/servers/tcp/port.go +++ b/testing/servers/tcp/port.go @@ -1,8 +1,8 @@ package tcp import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" ) // PickPort returns an unused TCP port in the system. The port returned is highly likely to be unused, but not guaranteed. diff --git a/testing/servers/tcp/tcp.go b/testing/servers/tcp/tcp.go index 04443c58d..484f2d760 100644 --- a/testing/servers/tcp/tcp.go +++ b/testing/servers/tcp/tcp.go @@ -5,11 +5,11 @@ import ( "fmt" "io" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/pipe" ) type Server struct { diff --git a/testing/servers/udp/port.go b/testing/servers/udp/port.go index 51e3559e7..ca8d3e473 100644 --- a/testing/servers/udp/port.go +++ b/testing/servers/udp/port.go @@ -1,8 +1,8 @@ package udp import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" ) // PickPort returns an unused UDP port in the system. The port returned is highly likely to be unused, but not guaranteed. diff --git a/testing/servers/udp/udp.go b/testing/servers/udp/udp.go index 9e9f0671c..c927d5e02 100644 --- a/testing/servers/udp/udp.go +++ b/testing/servers/udp/udp.go @@ -3,7 +3,7 @@ package udp import ( "fmt" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) type Server struct { diff --git a/transport/config.go b/transport/config.go index b25bb5375..c4a6c1241 100644 --- a/transport/config.go +++ b/transport/config.go @@ -1,7 +1,7 @@ package transport import ( - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/transport/internet" ) // Apply applies this Config. diff --git a/transport/config.pb.go b/transport/config.pb.go index 2918d1202..adc765658 100644 --- a/transport/config.pb.go +++ b/transport/config.pb.go @@ -8,7 +8,7 @@ package transport import ( proto "github.com/golang/protobuf/proto" - internet "github.com/xtls/xray-core/v1/transport/internet" + internet "github.com/xtls/xray-core/transport/internet" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -91,12 +91,12 @@ var file_transport_config_proto_rawDesc = []byte{ 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x3a, 0x02, 0x18, 0x01, - 0x42, 0x4f, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x42, 0x4c, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x01, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0xaa, 0x02, 0x0e, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, - 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0xaa, 0x02, 0x0e, + 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/config.proto b/transport/config.proto index b71a9914d..2380307df 100644 --- a/transport/config.proto +++ b/transport/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport; option csharp_namespace = "Xray.Transport"; -option go_package = "github.com/xtls/xray-core/v1/transport"; +option go_package = "github.com/xtls/xray-core/transport"; option java_package = "com.xray.transport"; option java_multiple_files = true; diff --git a/transport/internet/config.go b/transport/internet/config.go index 74db07c72..a7ff96c65 100644 --- a/transport/internet/config.go +++ b/transport/internet/config.go @@ -1,8 +1,8 @@ package internet import ( - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/features" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/features" ) type ConfigCreator func() interface{} diff --git a/transport/internet/config.pb.go b/transport/internet/config.pb.go index e80031fc8..3ed6b6e51 100644 --- a/transport/internet/config.pb.go +++ b/transport/internet/config.pb.go @@ -8,7 +8,7 @@ package internet import ( proto "github.com/golang/protobuf/proto" - serial "github.com/xtls/xray-core/v1/common/serial" + serial "github.com/xtls/xray-core/common/serial" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -584,14 +584,14 @@ var file_transport_internet_config_proto_rawDesc = []byte{ 0x08, 0x0a, 0x04, 0x4d, 0x4b, 0x43, 0x50, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x6f, 0x63, 0x6b, - 0x65, 0x74, 0x10, 0x05, 0x42, 0x6a, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, + 0x65, 0x74, 0x10, 0x05, 0x42, 0x67, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x17, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x17, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/config.proto b/transport/internet/config.proto index d6dc354ed..c45aa3a12 100644 --- a/transport/internet/config.proto +++ b/transport/internet/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet; option csharp_namespace = "Xray.Transport.Internet"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet"; +option go_package = "github.com/xtls/xray-core/transport/internet"; option java_package = "com.xray.transport.internet"; option java_multiple_files = true; diff --git a/transport/internet/connection.go b/transport/internet/connection.go index 1f083142f..4c04f89e4 100644 --- a/transport/internet/connection.go +++ b/transport/internet/connection.go @@ -3,7 +3,7 @@ package internet import ( "net" - "github.com/xtls/xray-core/v1/features/stats" + "github.com/xtls/xray-core/features/stats" ) type Connection interface { diff --git a/transport/internet/dialer.go b/transport/internet/dialer.go index cfd40c934..5c13b7995 100644 --- a/transport/internet/dialer.go +++ b/transport/internet/dialer.go @@ -3,8 +3,8 @@ package internet import ( "context" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" ) // Dialer is the interface for dialing outbound connections. diff --git a/transport/internet/dialer_test.go b/transport/internet/dialer_test.go index 793c60b60..232ee7098 100644 --- a/transport/internet/dialer_test.go +++ b/transport/internet/dialer_test.go @@ -6,10 +6,10 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - . "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/testing/servers/tcp" + . "github.com/xtls/xray-core/transport/internet" ) func TestDialWithLocalAddr(t *testing.T) { diff --git a/transport/internet/domainsocket/config.go b/transport/internet/domainsocket/config.go index 68dc60a97..950246dd2 100644 --- a/transport/internet/domainsocket/config.go +++ b/transport/internet/domainsocket/config.go @@ -3,9 +3,9 @@ package domainsocket import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" ) const protocolName = "domainsocket" diff --git a/transport/internet/domainsocket/config.pb.go b/transport/internet/domainsocket/config.pb.go index 3aff9d644..0334e1093 100644 --- a/transport/internet/domainsocket/config.pb.go +++ b/transport/internet/domainsocket/config.pb.go @@ -108,17 +108,17 @@ var file_transport_internet_domainsocket_config_proto_rawDesc = []byte{ 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x91, 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, + 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x8e, 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, - 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, - 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, - 0x6f, 0x63, 0x6b, 0x65, 0x74, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, - 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x6f, 0x63, 0x6b, + 0x65, 0x74, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, + 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x44, 0x6f, 0x6d, + 0x61, 0x69, 0x6e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/transport/internet/domainsocket/config.proto b/transport/internet/domainsocket/config.proto index dcefa75d5..900dbbe3d 100644 --- a/transport/internet/domainsocket/config.proto +++ b/transport/internet/domainsocket/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.domainsocket; option csharp_namespace = "Xray.Transport.Internet.DomainSocket"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/domainsocket"; +option go_package = "github.com/xtls/xray-core/transport/internet/domainsocket"; option java_package = "com.xray.transport.internet.domainsocket"; option java_multiple_files = true; diff --git a/transport/internet/domainsocket/dial.go b/transport/internet/domainsocket/dial.go index 86e144ff9..ea3ad6094 100644 --- a/transport/internet/domainsocket/dial.go +++ b/transport/internet/domainsocket/dial.go @@ -7,11 +7,11 @@ package domainsocket import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/xtls" ) func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.MemoryStreamConfig) (internet.Connection, error) { diff --git a/transport/internet/domainsocket/errgen.go b/transport/internet/domainsocket/errgen.go index 3df24e148..83ac04d00 100644 --- a/transport/internet/domainsocket/errgen.go +++ b/transport/internet/domainsocket/errgen.go @@ -1,3 +1,3 @@ package domainsocket -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/transport/internet/domainsocket/errors.generated.go b/transport/internet/domainsocket/errors.generated.go index ff14bd14c..451b1aa6c 100644 --- a/transport/internet/domainsocket/errors.generated.go +++ b/transport/internet/domainsocket/errors.generated.go @@ -1,6 +1,6 @@ package domainsocket -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/domainsocket/listener.go b/transport/internet/domainsocket/listener.go index 608270762..25cf75fd5 100644 --- a/transport/internet/domainsocket/listener.go +++ b/transport/internet/domainsocket/listener.go @@ -13,11 +13,11 @@ import ( goxtls "github.com/xtls/go" "golang.org/x/sys/unix" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/xtls" ) type Listener struct { diff --git a/transport/internet/domainsocket/listener_test.go b/transport/internet/domainsocket/listener_test.go index 662d45d13..ee8f4a0bf 100644 --- a/transport/internet/domainsocket/listener_test.go +++ b/transport/internet/domainsocket/listener_test.go @@ -7,11 +7,11 @@ import ( "runtime" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" - . "github.com/xtls/xray-core/v1/transport/internet/domainsocket" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" + . "github.com/xtls/xray-core/transport/internet/domainsocket" ) func TestListen(t *testing.T) { diff --git a/transport/internet/errors.generated.go b/transport/internet/errors.generated.go index b1390705b..caf158a11 100644 --- a/transport/internet/errors.generated.go +++ b/transport/internet/errors.generated.go @@ -1,6 +1,6 @@ package internet -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/header.go b/transport/internet/header.go index 6e7ed4e0e..1fc67133f 100644 --- a/transport/internet/header.go +++ b/transport/internet/header.go @@ -4,7 +4,7 @@ import ( "context" "net" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) type PacketHeader interface { diff --git a/transport/internet/header_test.go b/transport/internet/header_test.go index 587339eb6..e87ee7843 100644 --- a/transport/internet/header_test.go +++ b/transport/internet/header_test.go @@ -3,13 +3,13 @@ package internet_test import ( "testing" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/headers/noop" - "github.com/xtls/xray-core/v1/transport/internet/headers/srtp" - "github.com/xtls/xray-core/v1/transport/internet/headers/utp" - "github.com/xtls/xray-core/v1/transport/internet/headers/wechat" - "github.com/xtls/xray-core/v1/transport/internet/headers/wireguard" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/headers/noop" + "github.com/xtls/xray-core/transport/internet/headers/srtp" + "github.com/xtls/xray-core/transport/internet/headers/utp" + "github.com/xtls/xray-core/transport/internet/headers/wechat" + "github.com/xtls/xray-core/transport/internet/headers/wireguard" ) func TestAllHeadersLoadable(t *testing.T) { diff --git a/transport/internet/headers/http/config.go b/transport/internet/headers/http/config.go index 2778e364b..baa69663b 100644 --- a/transport/internet/headers/http/config.go +++ b/transport/internet/headers/http/config.go @@ -3,7 +3,7 @@ package http import ( "strings" - "github.com/xtls/xray-core/v1/common/dice" + "github.com/xtls/xray-core/common/dice" ) func pickString(arr []string) string { diff --git a/transport/internet/headers/http/config.pb.go b/transport/internet/headers/http/config.pb.go index 6bfdb07d5..f370a9680 100644 --- a/transport/internet/headers/http/config.pb.go +++ b/transport/internet/headers/http/config.pb.go @@ -491,17 +491,17 @@ var file_transport_internet_headers_http_config_proto_rawDesc = []byte{ 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x91, 0x01, 0x0a, + 0x69, 0x67, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x8e, 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, + 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, - 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x2f, 0x68, 0x74, 0x74, 0x70, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x48, 0x74, 0x74, 0x70, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x2f, 0x68, 0x74, 0x74, 0x70, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, + 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/headers/http/config.proto b/transport/internet/headers/http/config.proto index 9e09871e5..c76593711 100644 --- a/transport/internet/headers/http/config.proto +++ b/transport/internet/headers/http/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.headers.http; option csharp_namespace = "Xray.Transport.Internet.Headers.Http"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/headers/http"; +option go_package = "github.com/xtls/xray-core/transport/internet/headers/http"; option java_package = "com.xray.transport.internet.headers.http"; option java_multiple_files = true; diff --git a/transport/internet/headers/http/errors.generated.go b/transport/internet/headers/http/errors.generated.go index b07b3feca..f00481654 100644 --- a/transport/internet/headers/http/errors.generated.go +++ b/transport/internet/headers/http/errors.generated.go @@ -1,6 +1,6 @@ package http -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/headers/http/http.go b/transport/internet/headers/http/http.go index c6be04874..8b9340de1 100644 --- a/transport/internet/headers/http/http.go +++ b/transport/internet/headers/http/http.go @@ -1,6 +1,6 @@ package http -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "bufio" @@ -12,8 +12,8 @@ import ( "strings" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" ) const ( diff --git a/transport/internet/headers/http/http_test.go b/transport/internet/headers/http/http_test.go index 6a5540dfe..8591a199f 100644 --- a/transport/internet/headers/http/http_test.go +++ b/transport/internet/headers/http/http_test.go @@ -9,10 +9,10 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/transport/internet/headers/http" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/transport/internet/headers/http" ) func TestReaderWriter(t *testing.T) { diff --git a/transport/internet/headers/noop/config.pb.go b/transport/internet/headers/noop/config.pb.go index fc6f33991..d8cce3546 100644 --- a/transport/internet/headers/noop/config.pb.go +++ b/transport/internet/headers/noop/config.pb.go @@ -111,16 +111,16 @@ var file_transport_internet_headers_noop_config_proto_rawDesc = []byte{ 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x6e, 0x6f, 0x6f, 0x70, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x12, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x42, 0x91, 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, + 0x69, 0x67, 0x42, 0x8e, 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x6e, 0x6f, 0x6f, 0x70, 0x50, - 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, - 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x6e, 0x6f, 0x6f, 0x70, 0xaa, - 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x73, 0x2e, 0x4e, 0x6f, 0x6f, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, + 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x6e, 0x6f, 0x6f, 0x70, 0xaa, 0x02, 0x24, 0x58, + 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x4e, + 0x6f, 0x6f, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/headers/noop/config.proto b/transport/internet/headers/noop/config.proto index 0b63cc269..f23bc0a86 100644 --- a/transport/internet/headers/noop/config.proto +++ b/transport/internet/headers/noop/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.headers.noop; option csharp_namespace = "Xray.Transport.Internet.Headers.Noop"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/headers/noop"; +option go_package = "github.com/xtls/xray-core/transport/internet/headers/noop"; option java_package = "com.xray.transport.internet.headers.noop"; option java_multiple_files = true; diff --git a/transport/internet/headers/noop/noop.go b/transport/internet/headers/noop/noop.go index 764136123..90dae2edf 100644 --- a/transport/internet/headers/noop/noop.go +++ b/transport/internet/headers/noop/noop.go @@ -4,7 +4,7 @@ import ( "context" "net" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) type NoOpHeader struct{} diff --git a/transport/internet/headers/srtp/config.pb.go b/transport/internet/headers/srtp/config.pb.go index e48cb1765..300e45045 100644 --- a/transport/internet/headers/srtp/config.pb.go +++ b/transport/internet/headers/srtp/config.pb.go @@ -131,17 +131,17 @@ var file_transport_internet_headers_srtp_config_proto_rawDesc = []byte{ 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x42, 0x91, 0x01, 0x0a, 0x28, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x42, 0x8e, 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x2e, 0x73, 0x72, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, + 0x65, 0x72, 0x73, 0x2e, 0x73, 0x72, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x2f, 0x73, 0x72, 0x74, 0x70, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x72, 0x74, 0x70, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x2f, 0x73, 0x72, 0x74, 0x70, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x72, 0x74, 0x70, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/headers/srtp/config.proto b/transport/internet/headers/srtp/config.proto index e7a4c662d..491e299ca 100644 --- a/transport/internet/headers/srtp/config.proto +++ b/transport/internet/headers/srtp/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.headers.srtp; option csharp_namespace = "Xray.Transport.Internet.Headers.Srtp"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/headers/srtp"; +option go_package = "github.com/xtls/xray-core/transport/internet/headers/srtp"; option java_package = "com.xray.transport.internet.headers.srtp"; option java_multiple_files = true; diff --git a/transport/internet/headers/srtp/srtp.go b/transport/internet/headers/srtp/srtp.go index 50c107359..f85b04d78 100644 --- a/transport/internet/headers/srtp/srtp.go +++ b/transport/internet/headers/srtp/srtp.go @@ -4,8 +4,8 @@ import ( "context" "encoding/binary" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/dice" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/dice" ) type SRTP struct { diff --git a/transport/internet/headers/srtp/srtp_test.go b/transport/internet/headers/srtp/srtp_test.go index f9230d3c1..e350dba71 100644 --- a/transport/internet/headers/srtp/srtp_test.go +++ b/transport/internet/headers/srtp/srtp_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/transport/internet/headers/srtp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/transport/internet/headers/srtp" ) func TestSRTPWrite(t *testing.T) { diff --git a/transport/internet/headers/tls/config.pb.go b/transport/internet/headers/tls/config.pb.go index c3ecaa886..95b21e56c 100644 --- a/transport/internet/headers/tls/config.pb.go +++ b/transport/internet/headers/tls/config.pb.go @@ -72,16 +72,16 @@ var file_transport_internet_headers_tls_config_proto_rawDesc = []byte{ 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x74, 0x6c, 0x73, 0x22, 0x0e, 0x0a, 0x0c, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x42, 0x8e, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, + 0x69, 0x67, 0x42, 0x8b, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x74, 0x6c, 0x73, 0x50, 0x01, - 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, - 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, - 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x74, 0x6c, 0x73, 0xaa, 0x02, 0x23, - 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, - 0x54, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, + 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x74, 0x6c, 0x73, 0xaa, 0x02, 0x23, 0x58, 0x72, 0x61, + 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x54, 0x6c, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/headers/tls/config.proto b/transport/internet/headers/tls/config.proto index a4d3fcd70..f939adfc1 100644 --- a/transport/internet/headers/tls/config.proto +++ b/transport/internet/headers/tls/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.headers.tls; option csharp_namespace = "Xray.Transport.Internet.Headers.Tls"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/headers/tls"; +option go_package = "github.com/xtls/xray-core/transport/internet/headers/tls"; option java_package = "com.xray.transport.internet.headers.tls"; option java_multiple_files = true; diff --git a/transport/internet/headers/tls/dtls.go b/transport/internet/headers/tls/dtls.go index 8483a9efa..dda903c0c 100644 --- a/transport/internet/headers/tls/dtls.go +++ b/transport/internet/headers/tls/dtls.go @@ -3,8 +3,8 @@ package tls import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/dice" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/dice" ) // DTLS writes header as DTLS. See https://tools.ietf.org/html/rfc6347 diff --git a/transport/internet/headers/tls/dtls_test.go b/transport/internet/headers/tls/dtls_test.go index 7ee0be1db..26fd3aab7 100644 --- a/transport/internet/headers/tls/dtls_test.go +++ b/transport/internet/headers/tls/dtls_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/transport/internet/headers/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/transport/internet/headers/tls" ) func TestDTLSWrite(t *testing.T) { diff --git a/transport/internet/headers/utp/config.pb.go b/transport/internet/headers/utp/config.pb.go index 00757f71d..ebaa49781 100644 --- a/transport/internet/headers/utp/config.pb.go +++ b/transport/internet/headers/utp/config.pb.go @@ -82,16 +82,16 @@ var file_transport_internet_headers_utp_config_proto_rawDesc = []byte{ 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x75, 0x74, 0x70, 0x22, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x8e, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x78, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x8b, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x75, - 0x74, 0x70, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x74, 0x70, 0x50, 0x01, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x75, 0x74, - 0x70, 0xaa, 0x02, 0x23, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x2e, 0x55, 0x74, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x75, 0x74, 0x70, 0xaa, 0x02, + 0x23, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, + 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x2e, 0x55, 0x74, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/headers/utp/config.proto b/transport/internet/headers/utp/config.proto index a3d480fb1..0b3627d26 100644 --- a/transport/internet/headers/utp/config.proto +++ b/transport/internet/headers/utp/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.headers.utp; option csharp_namespace = "Xray.Transport.Internet.Headers.Utp"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/headers/utp"; +option go_package = "github.com/xtls/xray-core/transport/internet/headers/utp"; option java_package = "com.xray.transport.internet.headers.utp"; option java_multiple_files = true; diff --git a/transport/internet/headers/utp/utp.go b/transport/internet/headers/utp/utp.go index 9709afe22..89688068c 100644 --- a/transport/internet/headers/utp/utp.go +++ b/transport/internet/headers/utp/utp.go @@ -4,8 +4,8 @@ import ( "context" "encoding/binary" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/dice" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/dice" ) type UTP struct { diff --git a/transport/internet/headers/utp/utp_test.go b/transport/internet/headers/utp/utp_test.go index 25af8897a..b98755cd0 100644 --- a/transport/internet/headers/utp/utp_test.go +++ b/transport/internet/headers/utp/utp_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/transport/internet/headers/utp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/transport/internet/headers/utp" ) func TestUTPWrite(t *testing.T) { diff --git a/transport/internet/headers/wechat/config.pb.go b/transport/internet/headers/wechat/config.pb.go index 17635f05f..7dd697f84 100644 --- a/transport/internet/headers/wechat/config.pb.go +++ b/transport/internet/headers/wechat/config.pb.go @@ -72,17 +72,17 @@ var file_transport_internet_headers_wechat_config_proto_rawDesc = []byte{ 0x12, 0x26, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x22, 0x0d, 0x0a, 0x0b, 0x56, 0x69, 0x64, 0x65, - 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x97, 0x01, 0x0a, 0x2a, 0x63, 0x6f, 0x6d, 0x2e, + 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x94, 0x01, 0x0a, 0x2a, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, - 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x73, 0x2f, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0xaa, 0x02, 0x26, 0x58, 0x72, 0x61, 0x79, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x57, 0x65, 0x63, 0x68, 0x61, - 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x77, + 0x65, 0x63, 0x68, 0x61, 0x74, 0xaa, 0x02, 0x26, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x57, 0x65, 0x63, 0x68, 0x61, 0x74, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/headers/wechat/config.proto b/transport/internet/headers/wechat/config.proto index 5b268c55d..524c6dc0f 100644 --- a/transport/internet/headers/wechat/config.proto +++ b/transport/internet/headers/wechat/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.headers.wechat; option csharp_namespace = "Xray.Transport.Internet.Headers.Wechat"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/headers/wechat"; +option go_package = "github.com/xtls/xray-core/transport/internet/headers/wechat"; option java_package = "com.xray.transport.internet.headers.wechat"; option java_multiple_files = true; diff --git a/transport/internet/headers/wechat/wechat.go b/transport/internet/headers/wechat/wechat.go index d7d71ef15..ec6f08219 100644 --- a/transport/internet/headers/wechat/wechat.go +++ b/transport/internet/headers/wechat/wechat.go @@ -4,8 +4,8 @@ import ( "context" "encoding/binary" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/dice" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/dice" ) type VideoChat struct { diff --git a/transport/internet/headers/wechat/wechat_test.go b/transport/internet/headers/wechat/wechat_test.go index 4a254f0aa..5942a7dda 100644 --- a/transport/internet/headers/wechat/wechat_test.go +++ b/transport/internet/headers/wechat/wechat_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/transport/internet/headers/wechat" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/transport/internet/headers/wechat" ) func TestUTPWrite(t *testing.T) { diff --git a/transport/internet/headers/wireguard/config.pb.go b/transport/internet/headers/wireguard/config.pb.go index 0c9ac3fc3..4c78e85d6 100644 --- a/transport/internet/headers/wireguard/config.pb.go +++ b/transport/internet/headers/wireguard/config.pb.go @@ -73,17 +73,17 @@ var file_transport_internet_headers_wireguard_config_proto_rawDesc = []byte{ 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x77, 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x57, 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x42, 0xa0, 0x01, 0x0a, 0x2d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, + 0x67, 0x42, 0x9d, 0x01, 0x0a, 0x2d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x77, 0x69, 0x72, 0x65, 0x67, 0x75, - 0x61, 0x72, 0x64, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x61, 0x72, 0x64, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x77, - 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0xaa, 0x02, 0x29, 0x58, 0x72, 0x61, 0x79, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x57, 0x69, 0x72, 0x65, 0x67, - 0x75, 0x61, 0x72, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x77, 0x69, 0x72, 0x65, + 0x67, 0x75, 0x61, 0x72, 0x64, 0xaa, 0x02, 0x29, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x57, 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, + 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/headers/wireguard/config.proto b/transport/internet/headers/wireguard/config.proto index e917bf435..a115797a5 100644 --- a/transport/internet/headers/wireguard/config.proto +++ b/transport/internet/headers/wireguard/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.headers.wireguard; option csharp_namespace = "Xray.Transport.Internet.Headers.Wireguard"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/headers/wireguard"; +option go_package = "github.com/xtls/xray-core/transport/internet/headers/wireguard"; option java_package = "com.xray.transport.internet.headers.wireguard"; option java_multiple_files = true; diff --git a/transport/internet/headers/wireguard/wireguard.go b/transport/internet/headers/wireguard/wireguard.go index b7425bdf1..4ced1bc32 100644 --- a/transport/internet/headers/wireguard/wireguard.go +++ b/transport/internet/headers/wireguard/wireguard.go @@ -3,7 +3,7 @@ package wireguard import ( "context" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) type Wireguard struct{} diff --git a/transport/internet/http/config.go b/transport/internet/http/config.go index dc9260ba5..d81396774 100644 --- a/transport/internet/http/config.go +++ b/transport/internet/http/config.go @@ -3,9 +3,9 @@ package http import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/transport/internet" ) const protocolName = "http" diff --git a/transport/internet/http/config.pb.go b/transport/internet/http/config.pb.go index 44552c4bc..94b7d434d 100644 --- a/transport/internet/http/config.pb.go +++ b/transport/internet/http/config.pb.go @@ -90,15 +90,15 @@ var file_transport_internet_http_config_proto_rawDesc = []byte{ 0x68, 0x74, 0x74, 0x70, 0x22, 0x30, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x42, 0x79, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, + 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x42, 0x76, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, + 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, - 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x74, - 0x74, 0x70, 0xaa, 0x02, 0x1c, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x74, 0x74, - 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, + 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x74, 0x74, 0x70, 0xaa, + 0x02, 0x1c, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, + 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/http/config.proto b/transport/internet/http/config.proto index 2b86e9c80..34433af52 100644 --- a/transport/internet/http/config.proto +++ b/transport/internet/http/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.http; option csharp_namespace = "Xray.Transport.Internet.Http"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/http"; +option go_package = "github.com/xtls/xray-core/transport/internet/http"; option java_package = "com.xray.transport.internet.http"; option java_multiple_files = true; diff --git a/transport/internet/http/dialer.go b/transport/internet/http/dialer.go index 59a13d4d2..610fd8cf6 100644 --- a/transport/internet/http/dialer.go +++ b/transport/internet/http/dialer.go @@ -9,12 +9,12 @@ import ( "net/url" "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/pipe" "golang.org/x/net/http2" ) diff --git a/transport/internet/http/errors.generated.go b/transport/internet/http/errors.generated.go index b07b3feca..f00481654 100644 --- a/transport/internet/http/errors.generated.go +++ b/transport/internet/http/errors.generated.go @@ -1,6 +1,6 @@ package http -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/http/http.go b/transport/internet/http/http.go index 9dc785321..3c0d015f0 100644 --- a/transport/internet/http/http.go +++ b/transport/internet/http/http.go @@ -1,3 +1,3 @@ package http -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/transport/internet/http/http_test.go b/transport/internet/http/http_test.go index 5e954e6e3..ca1d9f2bd 100644 --- a/transport/internet/http/http_test.go +++ b/transport/internet/http/http_test.go @@ -8,14 +8,14 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/transport/internet" - . "github.com/xtls/xray-core/v1/transport/internet/http" - "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/transport/internet" + . "github.com/xtls/xray-core/transport/internet/http" + "github.com/xtls/xray-core/transport/internet/tls" ) func TestHTTPConnection(t *testing.T) { diff --git a/transport/internet/http/hub.go b/transport/internet/http/hub.go index 356679b59..712ee6d37 100644 --- a/transport/internet/http/hub.go +++ b/transport/internet/http/hub.go @@ -14,14 +14,14 @@ import ( "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - http_proto "github.com/xtls/xray-core/v1/common/protocol/http" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + http_proto "github.com/xtls/xray-core/common/protocol/http" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" ) type Listener struct { diff --git a/transport/internet/internet.go b/transport/internet/internet.go index c880eca38..694129ad0 100644 --- a/transport/internet/internet.go +++ b/transport/internet/internet.go @@ -1,3 +1,3 @@ package internet -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/transport/internet/kcp/config.go b/transport/internet/kcp/config.go index e6af64efd..51630e08e 100644 --- a/transport/internet/kcp/config.go +++ b/transport/internet/kcp/config.go @@ -5,8 +5,8 @@ package kcp import ( "crypto/cipher" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/transport/internet" ) const protocolName = "mkcp" diff --git a/transport/internet/kcp/config.pb.go b/transport/internet/kcp/config.pb.go index e7c21cdf3..fb5f2564f 100644 --- a/transport/internet/kcp/config.pb.go +++ b/transport/internet/kcp/config.pb.go @@ -8,7 +8,7 @@ package kcp import ( proto "github.com/golang/protobuf/proto" - serial "github.com/xtls/xray-core/v1/common/serial" + serial "github.com/xtls/xray-core/common/serial" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -586,15 +586,14 @@ var file_transport_internet_kcp_config_proto_rawDesc = []byte{ 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x6b, 0x63, 0x70, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x65, 0x64, 0x52, 0x04, 0x73, 0x65, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x09, 0x10, - 0x0a, 0x42, 0x76, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, + 0x0a, 0x42, 0x73, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x2e, 0x6b, 0x63, 0x70, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x2e, 0x6b, 0x63, 0x70, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, - 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x6b, 0x63, 0x70, 0xaa, 0x02, 0x1b, 0x58, 0x72, - 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x4b, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x6b, 0x63, 0x70, 0xaa, 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x65, 0x74, 0x2e, 0x4b, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/kcp/config.proto b/transport/internet/kcp/config.proto index c8761eda6..a9806e6f2 100644 --- a/transport/internet/kcp/config.proto +++ b/transport/internet/kcp/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.kcp; option csharp_namespace = "Xray.Transport.Internet.Kcp"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/kcp"; +option go_package = "github.com/xtls/xray-core/transport/internet/kcp"; option java_package = "com.xray.transport.internet.kcp"; option java_multiple_files = true; diff --git a/transport/internet/kcp/connection.go b/transport/internet/kcp/connection.go index 561afd3a8..ce46e9310 100644 --- a/transport/internet/kcp/connection.go +++ b/transport/internet/kcp/connection.go @@ -11,9 +11,9 @@ import ( "sync/atomic" "time" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/signal/semaphore" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/signal/semaphore" ) var ( diff --git a/transport/internet/kcp/connection_test.go b/transport/internet/kcp/connection_test.go index f6d64f8e4..daa458204 100644 --- a/transport/internet/kcp/connection_test.go +++ b/transport/internet/kcp/connection_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/transport/internet/kcp" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/transport/internet/kcp" ) type NoOpCloser int diff --git a/transport/internet/kcp/crypt.go b/transport/internet/kcp/crypt.go index 7ccb737cf..b29da679f 100644 --- a/transport/internet/kcp/crypt.go +++ b/transport/internet/kcp/crypt.go @@ -7,7 +7,7 @@ import ( "encoding/binary" "hash/fnv" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) // SimpleAuthenticator is a legacy AEAD used for KCP encryption. diff --git a/transport/internet/kcp/crypt_test.go b/transport/internet/kcp/crypt_test.go index 8a61c8f50..42b177d7a 100644 --- a/transport/internet/kcp/crypt_test.go +++ b/transport/internet/kcp/crypt_test.go @@ -5,8 +5,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/transport/internet/kcp" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/transport/internet/kcp" ) func TestSimpleAuthenticator(t *testing.T) { diff --git a/transport/internet/kcp/cryptreal.go b/transport/internet/kcp/cryptreal.go index 51aa0fefe..e86bba987 100644 --- a/transport/internet/kcp/cryptreal.go +++ b/transport/internet/kcp/cryptreal.go @@ -5,7 +5,7 @@ import ( "crypto/cipher" "crypto/sha256" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) func NewAEADAESGCMBasedOnSeed(seed string) cipher.AEAD { diff --git a/transport/internet/kcp/dialer.go b/transport/internet/kcp/dialer.go index 3ee506a4e..61b1afd6d 100644 --- a/transport/internet/kcp/dialer.go +++ b/transport/internet/kcp/dialer.go @@ -7,13 +7,13 @@ import ( "io" "sync/atomic" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/xtls" ) var ( diff --git a/transport/internet/kcp/errors.generated.go b/transport/internet/kcp/errors.generated.go index 604d4fe4d..63c51c6ff 100644 --- a/transport/internet/kcp/errors.generated.go +++ b/transport/internet/kcp/errors.generated.go @@ -1,6 +1,6 @@ package kcp -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/kcp/io.go b/transport/internet/kcp/io.go index 3a92a404e..dd7aecb37 100644 --- a/transport/internet/kcp/io.go +++ b/transport/internet/kcp/io.go @@ -7,9 +7,9 @@ import ( "crypto/rand" "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/transport/internet" ) type PacketReader interface { diff --git a/transport/internet/kcp/io_test.go b/transport/internet/kcp/io_test.go index d15dd77b1..0e9f6291d 100644 --- a/transport/internet/kcp/io_test.go +++ b/transport/internet/kcp/io_test.go @@ -3,7 +3,7 @@ package kcp_test import ( "testing" - . "github.com/xtls/xray-core/v1/transport/internet/kcp" + . "github.com/xtls/xray-core/transport/internet/kcp" ) func TestKCPPacketReader(t *testing.T) { diff --git a/transport/internet/kcp/kcp.go b/transport/internet/kcp/kcp.go index ebcf7c521..242dce949 100644 --- a/transport/internet/kcp/kcp.go +++ b/transport/internet/kcp/kcp.go @@ -5,4 +5,4 @@ // xtaci@github for translating to Golang package kcp -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/transport/internet/kcp/kcp_test.go b/transport/internet/kcp/kcp_test.go index 0557664bc..c6086bc52 100644 --- a/transport/internet/kcp/kcp_test.go +++ b/transport/internet/kcp/kcp_test.go @@ -10,11 +10,11 @@ import ( "github.com/google/go-cmp/cmp" "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" - . "github.com/xtls/xray-core/v1/transport/internet/kcp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" + . "github.com/xtls/xray-core/transport/internet/kcp" ) func TestDialAndListen(t *testing.T) { diff --git a/transport/internet/kcp/listener.go b/transport/internet/kcp/listener.go index 880732078..08d0421b8 100644 --- a/transport/internet/kcp/listener.go +++ b/transport/internet/kcp/listener.go @@ -10,13 +10,13 @@ import ( goxtls "github.com/xtls/go" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/udp" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/udp" + "github.com/xtls/xray-core/transport/internet/xtls" ) type ConnectionID struct { diff --git a/transport/internet/kcp/output.go b/transport/internet/kcp/output.go index 087ee017b..0302048df 100644 --- a/transport/internet/kcp/output.go +++ b/transport/internet/kcp/output.go @@ -6,9 +6,9 @@ import ( "io" "sync" - "github.com/xtls/xray-core/v1/common/retry" + "github.com/xtls/xray-core/common/retry" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) type SegmentWriter interface { diff --git a/transport/internet/kcp/receiving.go b/transport/internet/kcp/receiving.go index c21091b2e..de1c53a06 100644 --- a/transport/internet/kcp/receiving.go +++ b/transport/internet/kcp/receiving.go @@ -5,7 +5,7 @@ package kcp import ( "sync" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) type ReceivingWindow struct { diff --git a/transport/internet/kcp/segment.go b/transport/internet/kcp/segment.go index 9743061c1..aa8bfd04a 100644 --- a/transport/internet/kcp/segment.go +++ b/transport/internet/kcp/segment.go @@ -5,7 +5,7 @@ package kcp import ( "encoding/binary" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) // Command is a KCP command that indicate the purpose of a Segment. diff --git a/transport/internet/kcp/segment_test.go b/transport/internet/kcp/segment_test.go index 5d099ce14..571023423 100644 --- a/transport/internet/kcp/segment_test.go +++ b/transport/internet/kcp/segment_test.go @@ -6,7 +6,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - . "github.com/xtls/xray-core/v1/transport/internet/kcp" + . "github.com/xtls/xray-core/transport/internet/kcp" ) func TestBadSegment(t *testing.T) { diff --git a/transport/internet/kcp/sending.go b/transport/internet/kcp/sending.go index 84e15d2c4..67e6790f5 100644 --- a/transport/internet/kcp/sending.go +++ b/transport/internet/kcp/sending.go @@ -6,7 +6,7 @@ import ( "container/list" "sync" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) type SendingWindow struct { diff --git a/transport/internet/quic/config.go b/transport/internet/quic/config.go index 79e7d1320..79d24682e 100644 --- a/transport/internet/quic/config.go +++ b/transport/internet/quic/config.go @@ -7,9 +7,9 @@ import ( "crypto/cipher" "crypto/sha256" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/transport/internet" "golang.org/x/crypto/chacha20poly1305" ) diff --git a/transport/internet/quic/config.pb.go b/transport/internet/quic/config.pb.go index b58ab3f59..839c5305f 100644 --- a/transport/internet/quic/config.pb.go +++ b/transport/internet/quic/config.pb.go @@ -8,8 +8,8 @@ package quic import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" - serial "github.com/xtls/xray-core/v1/common/serial" + protocol "github.com/xtls/xray-core/common/protocol" + serial "github.com/xtls/xray-core/common/serial" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -111,15 +111,14 @@ var file_transport_internet_quic_config_proto_rawDesc = []byte{ 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, - 0x79, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, + 0x76, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x71, - 0x75, 0x69, 0x63, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x75, 0x69, 0x63, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x71, 0x75, 0x69, 0x63, 0xaa, 0x02, 0x1c, 0x58, 0x72, - 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x51, 0x75, 0x69, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x65, 0x74, 0x2f, 0x71, 0x75, 0x69, 0x63, 0xaa, 0x02, 0x1c, 0x58, 0x72, 0x61, 0x79, 0x2e, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x65, 0x74, 0x2e, 0x51, 0x75, 0x69, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/quic/config.proto b/transport/internet/quic/config.proto index 92888d24b..b08e531e6 100644 --- a/transport/internet/quic/config.proto +++ b/transport/internet/quic/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.quic; option csharp_namespace = "Xray.Transport.Internet.Quic"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/quic"; +option go_package = "github.com/xtls/xray-core/transport/internet/quic"; option java_package = "com.xray.transport.internet.quic"; option java_multiple_files = true; diff --git a/transport/internet/quic/conn.go b/transport/internet/quic/conn.go index 23f3c2792..bd9c5366f 100644 --- a/transport/internet/quic/conn.go +++ b/transport/internet/quic/conn.go @@ -9,10 +9,10 @@ import ( "time" "github.com/lucas-clemente/quic-go" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" ) type sysConn struct { diff --git a/transport/internet/quic/dialer.go b/transport/internet/quic/dialer.go index 30029d5c2..ad3321914 100644 --- a/transport/internet/quic/dialer.go +++ b/transport/internet/quic/dialer.go @@ -8,11 +8,11 @@ import ( "time" "github.com/lucas-clemente/quic-go" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" ) type sessionContext struct { diff --git a/transport/internet/quic/errors.generated.go b/transport/internet/quic/errors.generated.go index b64d6f398..808fd980e 100644 --- a/transport/internet/quic/errors.generated.go +++ b/transport/internet/quic/errors.generated.go @@ -1,6 +1,6 @@ package quic -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/quic/hub.go b/transport/internet/quic/hub.go index 73fb7700b..bea6c2ace 100644 --- a/transport/internet/quic/hub.go +++ b/transport/internet/quic/hub.go @@ -7,12 +7,12 @@ import ( "time" "github.com/lucas-clemente/quic-go" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" ) // Listener is an internet.Listener that listens for TCP connections. diff --git a/transport/internet/quic/pool.go b/transport/internet/quic/pool.go index 2809520a9..124daa287 100644 --- a/transport/internet/quic/pool.go +++ b/transport/internet/quic/pool.go @@ -5,7 +5,7 @@ package quic import ( "sync" - "github.com/xtls/xray-core/v1/common/bytespool" + "github.com/xtls/xray-core/common/bytespool" ) var pool *sync.Pool diff --git a/transport/internet/quic/quic.go b/transport/internet/quic/quic.go index 47c3cc943..d11854e8a 100644 --- a/transport/internet/quic/quic.go +++ b/transport/internet/quic/quic.go @@ -3,11 +3,11 @@ package quic import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/transport/internet" ) -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen // Here is some modification needs to be done before update quic vendor. // * use bytespool in buffer_pool.go diff --git a/transport/internet/quic/quic_test.go b/transport/internet/quic/quic_test.go index defa80a61..bf353d835 100644 --- a/transport/internet/quic/quic_test.go +++ b/transport/internet/quic/quic_test.go @@ -8,17 +8,17 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/testing/servers/udp" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/headers/wireguard" - "github.com/xtls/xray-core/v1/transport/internet/quic" - "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/testing/servers/udp" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/headers/wireguard" + "github.com/xtls/xray-core/transport/internet/quic" + "github.com/xtls/xray-core/transport/internet/tls" ) func TestQuicConnection(t *testing.T) { diff --git a/transport/internet/sockopt_linux_test.go b/transport/internet/sockopt_linux_test.go index 40745d22d..17b7cee01 100644 --- a/transport/internet/sockopt_linux_test.go +++ b/transport/internet/sockopt_linux_test.go @@ -5,10 +5,10 @@ import ( "syscall" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - . "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/testing/servers/tcp" + . "github.com/xtls/xray-core/transport/internet" ) func TestSockOptMark(t *testing.T) { diff --git a/transport/internet/sockopt_test.go b/transport/internet/sockopt_test.go index a1944cbdf..729fb6841 100644 --- a/transport/internet/sockopt_test.go +++ b/transport/internet/sockopt_test.go @@ -5,10 +5,10 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - . "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/testing/servers/tcp" + . "github.com/xtls/xray-core/transport/internet" ) func TestTCPFastOpen(t *testing.T) { diff --git a/transport/internet/system_dialer.go b/transport/internet/system_dialer.go index 4a1052ebb..ef925971c 100644 --- a/transport/internet/system_dialer.go +++ b/transport/internet/system_dialer.go @@ -5,8 +5,8 @@ import ( "syscall" "time" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" ) var ( diff --git a/transport/internet/system_listener.go b/transport/internet/system_listener.go index 54ea4cfe7..2dc8a15ab 100644 --- a/transport/internet/system_listener.go +++ b/transport/internet/system_listener.go @@ -6,8 +6,8 @@ import ( "syscall" "github.com/pires/go-proxyproto" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" ) var ( diff --git a/transport/internet/system_listener_test.go b/transport/internet/system_listener_test.go index cdb90c18f..0fcc9a95a 100644 --- a/transport/internet/system_listener_test.go +++ b/transport/internet/system_listener_test.go @@ -5,8 +5,8 @@ import ( "net" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/transport/internet" ) func TestRegisterListenerController(t *testing.T) { diff --git a/transport/internet/tcp/config.go b/transport/internet/tcp/config.go index 7b42b682f..463957489 100644 --- a/transport/internet/tcp/config.go +++ b/transport/internet/tcp/config.go @@ -3,8 +3,8 @@ package tcp import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/transport/internet" ) const protocolName = "tcp" diff --git a/transport/internet/tcp/config.pb.go b/transport/internet/tcp/config.pb.go index 28d715a30..addb4613a 100644 --- a/transport/internet/tcp/config.pb.go +++ b/transport/internet/tcp/config.pb.go @@ -8,7 +8,7 @@ package tcp import ( proto "github.com/golang/protobuf/proto" - serial "github.com/xtls/xray-core/v1/common/serial" + serial "github.com/xtls/xray-core/common/serial" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -99,15 +99,15 @@ var file_transport_internet_tcp_config_proto_rawDesc = []byte{ 0x63, 0x63, 0x65, 0x70, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4a, - 0x04, 0x08, 0x01, 0x10, 0x02, 0x42, 0x76, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, + 0x04, 0x08, 0x01, 0x10, 0x02, 0x42, 0x73, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x74, 0x63, 0x70, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, + 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x74, 0x63, 0x70, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x74, 0x63, 0x70, 0xaa, - 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x63, 0x70, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x74, 0x63, 0x70, 0xaa, 0x02, 0x1b, 0x58, + 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/transport/internet/tcp/config.proto b/transport/internet/tcp/config.proto index 7ded64218..a12acdfaa 100644 --- a/transport/internet/tcp/config.proto +++ b/transport/internet/tcp/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.tcp; option csharp_namespace = "Xray.Transport.Internet.Tcp"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/tcp"; +option go_package = "github.com/xtls/xray-core/transport/internet/tcp"; option java_package = "com.xray.transport.internet.tcp"; option java_multiple_files = true; diff --git a/transport/internet/tcp/dialer.go b/transport/internet/tcp/dialer.go index 388aa90e5..819f7d62c 100644 --- a/transport/internet/tcp/dialer.go +++ b/transport/internet/tcp/dialer.go @@ -5,12 +5,12 @@ package tcp import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/xtls" ) // Dial dials a new TCP connection to the given destination. diff --git a/transport/internet/tcp/errors.generated.go b/transport/internet/tcp/errors.generated.go index 590fc4c79..0832d1143 100644 --- a/transport/internet/tcp/errors.generated.go +++ b/transport/internet/tcp/errors.generated.go @@ -1,6 +1,6 @@ package tcp -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/tcp/hub.go b/transport/internet/tcp/hub.go index f367b6289..009b838a6 100644 --- a/transport/internet/tcp/hub.go +++ b/transport/internet/tcp/hub.go @@ -10,12 +10,12 @@ import ( goxtls "github.com/xtls/go" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/xtls" ) // Listener is an internet.Listener that listens for TCP connections. diff --git a/transport/internet/tcp/sockopt_freebsd.go b/transport/internet/tcp/sockopt_freebsd.go index 70bb35498..883916136 100644 --- a/transport/internet/tcp/sockopt_freebsd.go +++ b/transport/internet/tcp/sockopt_freebsd.go @@ -4,8 +4,8 @@ package tcp import ( - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" ) // GetOriginalDestination from tcp conn diff --git a/transport/internet/tcp/sockopt_linux.go b/transport/internet/tcp/sockopt_linux.go index d53c5352f..d954a5cb9 100644 --- a/transport/internet/tcp/sockopt_linux.go +++ b/transport/internet/tcp/sockopt_linux.go @@ -6,8 +6,8 @@ package tcp import ( "syscall" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" ) const SO_ORIGINAL_DST = 80 diff --git a/transport/internet/tcp/sockopt_linux_test.go b/transport/internet/tcp/sockopt_linux_test.go index 0b56f27ca..c879b2bfc 100644 --- a/transport/internet/tcp/sockopt_linux_test.go +++ b/transport/internet/tcp/sockopt_linux_test.go @@ -7,10 +7,10 @@ import ( "strings" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/transport/internet" - . "github.com/xtls/xray-core/v1/transport/internet/tcp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/transport/internet" + . "github.com/xtls/xray-core/transport/internet/tcp" ) func TestGetOriginalDestination(t *testing.T) { diff --git a/transport/internet/tcp/sockopt_other.go b/transport/internet/tcp/sockopt_other.go index 2c2075be7..f21ba52ff 100644 --- a/transport/internet/tcp/sockopt_other.go +++ b/transport/internet/tcp/sockopt_other.go @@ -4,8 +4,8 @@ package tcp import ( - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" ) func GetOriginalDestination(conn internet.Connection) (net.Destination, error) { diff --git a/transport/internet/tcp/tcp.go b/transport/internet/tcp/tcp.go index d528c367c..f9e66d842 100644 --- a/transport/internet/tcp/tcp.go +++ b/transport/internet/tcp/tcp.go @@ -1,3 +1,3 @@ package tcp -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/transport/internet/tcp_hub.go b/transport/internet/tcp_hub.go index 5cece5c0b..fb5562dde 100644 --- a/transport/internet/tcp_hub.go +++ b/transport/internet/tcp_hub.go @@ -3,7 +3,7 @@ package internet import ( "context" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) var ( diff --git a/transport/internet/tls/config.go b/transport/internet/tls/config.go index adca4a2ba..856ab595e 100644 --- a/transport/internet/tls/config.go +++ b/transport/internet/tls/config.go @@ -9,9 +9,9 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/transport/internet" ) var ( diff --git a/transport/internet/tls/config.pb.go b/transport/internet/tls/config.pb.go index 38092740f..69cda53af 100644 --- a/transport/internet/tls/config.pb.go +++ b/transport/internet/tls/config.pb.go @@ -284,15 +284,15 @@ var file_transport_internet_tls_config_proto_rawDesc = []byte{ 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x76, 0x0a, 0x1f, 0x63, 0x6f, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x73, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x74, 0x6c, 0x73, 0x50, 0x01, 0x5a, - 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, - 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x2f, 0x74, 0x6c, 0x73, 0xaa, 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, - 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, + 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x74, 0x6c, + 0x73, 0xaa, 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, + 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x6c, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/tls/config.proto b/transport/internet/tls/config.proto index e03c0d65b..732bb72d2 100644 --- a/transport/internet/tls/config.proto +++ b/transport/internet/tls/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.tls; option csharp_namespace = "Xray.Transport.Internet.Tls"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/tls"; +option go_package = "github.com/xtls/xray-core/transport/internet/tls"; option java_package = "com.xray.transport.internet.tls"; option java_multiple_files = true; diff --git a/transport/internet/tls/config_test.go b/transport/internet/tls/config_test.go index 41a5c7ab9..5c8f567cb 100644 --- a/transport/internet/tls/config_test.go +++ b/transport/internet/tls/config_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - . "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/protocol/tls/cert" + . "github.com/xtls/xray-core/transport/internet/tls" ) func TestCertificateIssuing(t *testing.T) { diff --git a/transport/internet/tls/errors.generated.go b/transport/internet/tls/errors.generated.go index 8890e007d..ba1851c88 100644 --- a/transport/internet/tls/errors.generated.go +++ b/transport/internet/tls/errors.generated.go @@ -1,6 +1,6 @@ package tls -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/tls/tls.go b/transport/internet/tls/tls.go index f7889be69..3f2af9f97 100644 --- a/transport/internet/tls/tls.go +++ b/transport/internet/tls/tls.go @@ -5,11 +5,11 @@ package tls import ( "crypto/tls" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" ) -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen var ( _ buf.Writer = (*Conn)(nil) diff --git a/transport/internet/udp/config.go b/transport/internet/udp/config.go index 15b45ce95..fada89c20 100644 --- a/transport/internet/udp/config.go +++ b/transport/internet/udp/config.go @@ -1,8 +1,8 @@ package udp import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/transport/internet" ) func init() { diff --git a/transport/internet/udp/config.pb.go b/transport/internet/udp/config.pb.go index d5a7796aa..7e22cf264 100644 --- a/transport/internet/udp/config.pb.go +++ b/transport/internet/udp/config.pb.go @@ -70,15 +70,15 @@ var file_transport_internet_udp_config_proto_rawDesc = []byte{ 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x75, 0x64, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x75, - 0x64, 0x70, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x76, 0x0a, 0x1f, + 0x64, 0x70, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x73, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x75, 0x64, 0x70, 0x50, - 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, - 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2f, 0x75, 0x64, 0x70, 0xaa, 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x2e, 0x55, 0x64, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, + 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, + 0x75, 0x64, 0x70, 0xaa, 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x55, 0x64, + 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/udp/config.proto b/transport/internet/udp/config.proto index ffd00f7b0..16e043f9d 100644 --- a/transport/internet/udp/config.proto +++ b/transport/internet/udp/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.udp; option csharp_namespace = "Xray.Transport.Internet.Udp"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/udp"; +option go_package = "github.com/xtls/xray-core/transport/internet/udp"; option java_package = "com.xray.transport.internet.udp"; option java_multiple_files = true; diff --git a/transport/internet/udp/dialer.go b/transport/internet/udp/dialer.go index 653b4e963..283061124 100644 --- a/transport/internet/udp/dialer.go +++ b/transport/internet/udp/dialer.go @@ -3,9 +3,9 @@ package udp import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" ) func init() { diff --git a/transport/internet/udp/dispatcher.go b/transport/internet/udp/dispatcher.go index 73989ba8d..11c8357e9 100644 --- a/transport/internet/udp/dispatcher.go +++ b/transport/internet/udp/dispatcher.go @@ -6,16 +6,16 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common/signal/done" + "github.com/xtls/xray-core/common/signal/done" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/udp" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/udp" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport" ) type ResponseCallback func(ctx context.Context, packet *udp.Packet) diff --git a/transport/internet/udp/dispatcher_test.go b/transport/internet/udp/dispatcher_test.go index ce4de0fc4..a9e3c1fdc 100644 --- a/transport/internet/udp/dispatcher_test.go +++ b/transport/internet/udp/dispatcher_test.go @@ -6,14 +6,14 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/udp" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport" - . "github.com/xtls/xray-core/v1/transport/internet/udp" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/udp" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport" + . "github.com/xtls/xray-core/transport/internet/udp" + "github.com/xtls/xray-core/transport/pipe" ) type TestDispatcher struct { diff --git a/transport/internet/udp/errors.generated.go b/transport/internet/udp/errors.generated.go index 3d6b44f2e..b1b4aa709 100644 --- a/transport/internet/udp/errors.generated.go +++ b/transport/internet/udp/errors.generated.go @@ -1,6 +1,6 @@ package udp -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/udp/hub.go b/transport/internet/udp/hub.go index ab20e5807..d91f5536f 100644 --- a/transport/internet/udp/hub.go +++ b/transport/internet/udp/hub.go @@ -3,10 +3,10 @@ package udp import ( "context" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/udp" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/udp" + "github.com/xtls/xray-core/transport/internet" ) type HubOption func(h *Hub) diff --git a/transport/internet/udp/hub_freebsd.go b/transport/internet/udp/hub_freebsd.go index bc7649fdb..0438eeb27 100644 --- a/transport/internet/udp/hub_freebsd.go +++ b/transport/internet/udp/hub_freebsd.go @@ -7,8 +7,8 @@ import ( "encoding/gob" "io" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" ) // RetrieveOriginalDest from stored laddr, caddr diff --git a/transport/internet/udp/hub_linux.go b/transport/internet/udp/hub_linux.go index e0cfda7b1..b01dbd0bd 100644 --- a/transport/internet/udp/hub_linux.go +++ b/transport/internet/udp/hub_linux.go @@ -5,7 +5,7 @@ package udp import ( "syscall" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" "golang.org/x/sys/unix" ) diff --git a/transport/internet/udp/hub_other.go b/transport/internet/udp/hub_other.go index 10d16d54a..1a3c67735 100644 --- a/transport/internet/udp/hub_other.go +++ b/transport/internet/udp/hub_other.go @@ -3,7 +3,7 @@ package udp import ( - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) func RetrieveOriginalDest(oob []byte) net.Destination { diff --git a/transport/internet/udp/udp.go b/transport/internet/udp/udp.go index 525d6a850..d01148b2d 100644 --- a/transport/internet/udp/udp.go +++ b/transport/internet/udp/udp.go @@ -1,5 +1,5 @@ package udp -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen const protocolName = "udp" diff --git a/transport/internet/websocket/config.go b/transport/internet/websocket/config.go index 2dbbf9930..939d43352 100644 --- a/transport/internet/websocket/config.go +++ b/transport/internet/websocket/config.go @@ -5,8 +5,8 @@ package websocket import ( "net/http" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/transport/internet" ) const protocolName = "websocket" diff --git a/transport/internet/websocket/config.pb.go b/transport/internet/websocket/config.pb.go index 9009bdbae..1d3f8e22e 100644 --- a/transport/internet/websocket/config.pb.go +++ b/transport/internet/websocket/config.pb.go @@ -164,16 +164,16 @@ var file_transport_internet_websocket_config_proto_rawDesc = []byte{ 0x65, 0x72, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x42, 0x88, 0x01, 0x0a, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x42, 0x85, 0x01, 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x77, 0x65, 0x62, - 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, - 0x6b, 0x65, 0x74, 0xaa, 0x02, 0x21, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x57, 0x65, - 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, + 0xaa, 0x02, 0x21, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, + 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x57, 0x65, 0x62, 0x73, 0x6f, + 0x63, 0x6b, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/websocket/config.proto b/transport/internet/websocket/config.proto index e8ef9d1f9..0795c326e 100644 --- a/transport/internet/websocket/config.proto +++ b/transport/internet/websocket/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.websocket; option csharp_namespace = "Xray.Transport.Internet.Websocket"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/websocket"; +option go_package = "github.com/xtls/xray-core/transport/internet/websocket"; option java_package = "com.xray.transport.internet.websocket"; option java_multiple_files = true; diff --git a/transport/internet/websocket/connection.go b/transport/internet/websocket/connection.go index 1bae37ffc..5ef2a0304 100644 --- a/transport/internet/websocket/connection.go +++ b/transport/internet/websocket/connection.go @@ -8,9 +8,9 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/serial" ) var ( diff --git a/transport/internet/websocket/dialer.go b/transport/internet/websocket/dialer.go index ab3afa9db..b58e341d9 100644 --- a/transport/internet/websocket/dialer.go +++ b/transport/internet/websocket/dialer.go @@ -7,11 +7,11 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" ) // Dial dials a WebSocket connection to the given destination. diff --git a/transport/internet/websocket/errors.generated.go b/transport/internet/websocket/errors.generated.go index 3f628958e..2361d0a6a 100644 --- a/transport/internet/websocket/errors.generated.go +++ b/transport/internet/websocket/errors.generated.go @@ -1,6 +1,6 @@ package websocket -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/websocket/hub.go b/transport/internet/websocket/hub.go index 6b8e47337..aa20640cb 100644 --- a/transport/internet/websocket/hub.go +++ b/transport/internet/websocket/hub.go @@ -11,12 +11,12 @@ import ( "github.com/gorilla/websocket" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - http_proto "github.com/xtls/xray-core/v1/common/protocol/http" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/transport/internet" - v2tls "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + http_proto "github.com/xtls/xray-core/common/protocol/http" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/transport/internet" + v2tls "github.com/xtls/xray-core/transport/internet/tls" ) type requestHandler struct { diff --git a/transport/internet/websocket/ws.go b/transport/internet/websocket/ws.go index c28df03ac..661bb4c07 100644 --- a/transport/internet/websocket/ws.go +++ b/transport/internet/websocket/ws.go @@ -4,4 +4,4 @@ Websocket transport implements an HTTP(S) compliable, surveillance proof transpo */ package websocket -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/transport/internet/websocket/ws_test.go b/transport/internet/websocket/ws_test.go index c1b8e1cb5..15a11449d 100644 --- a/transport/internet/websocket/ws_test.go +++ b/transport/internet/websocket/ws_test.go @@ -6,12 +6,12 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - . "github.com/xtls/xray-core/v1/transport/internet/websocket" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + . "github.com/xtls/xray-core/transport/internet/websocket" ) func Test_listenWSAndDial(t *testing.T) { diff --git a/transport/internet/xtls/config.go b/transport/internet/xtls/config.go index 3ebc503af..d3c21eb09 100644 --- a/transport/internet/xtls/config.go +++ b/transport/internet/xtls/config.go @@ -9,9 +9,9 @@ import ( xtls "github.com/xtls/go" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/transport/internet" ) var ( diff --git a/transport/internet/xtls/config.pb.go b/transport/internet/xtls/config.pb.go index 701581bc5..349ebbf50 100644 --- a/transport/internet/xtls/config.pb.go +++ b/transport/internet/xtls/config.pb.go @@ -284,16 +284,15 @@ var file_transport_internet_xtls_config_proto_rawDesc = []byte{ 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, 0x69, 0x73, - 0x61, 0x62, 0x6c, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x79, + 0x61, 0x62, 0x6c, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x76, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x78, 0x74, - 0x6c, 0x73, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x6c, 0x73, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0xaa, 0x02, 0x1c, 0x58, 0x72, 0x61, - 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x58, 0x74, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x65, 0x74, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0xaa, 0x02, 0x1c, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, + 0x74, 0x2e, 0x58, 0x74, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/xtls/config.proto b/transport/internet/xtls/config.proto index 9cd0bb7c9..eceb406c1 100644 --- a/transport/internet/xtls/config.proto +++ b/transport/internet/xtls/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.xtls; option csharp_namespace = "Xray.Transport.Internet.Xtls"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/xtls"; +option go_package = "github.com/xtls/xray-core/transport/internet/xtls"; option java_package = "com.xray.transport.internet.xtls"; option java_multiple_files = true; diff --git a/transport/internet/xtls/config_test.go b/transport/internet/xtls/config_test.go index b63cea843..8f5b5ad4b 100644 --- a/transport/internet/xtls/config_test.go +++ b/transport/internet/xtls/config_test.go @@ -7,9 +7,9 @@ import ( xtls "github.com/xtls/go" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - . "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/protocol/tls/cert" + . "github.com/xtls/xray-core/transport/internet/xtls" ) func TestCertificateIssuing(t *testing.T) { diff --git a/transport/internet/xtls/errors.generated.go b/transport/internet/xtls/errors.generated.go index 044b75794..bce26cc1c 100644 --- a/transport/internet/xtls/errors.generated.go +++ b/transport/internet/xtls/errors.generated.go @@ -1,6 +1,6 @@ package xtls -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/xtls/xtls.go b/transport/internet/xtls/xtls.go index e0787a7b3..3923d0522 100644 --- a/transport/internet/xtls/xtls.go +++ b/transport/internet/xtls/xtls.go @@ -5,10 +5,10 @@ package xtls import ( xtls "github.com/xtls/go" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen type Conn struct { *xtls.Conn diff --git a/transport/link.go b/transport/link.go index e9ffd1c06..53e310e0d 100644 --- a/transport/link.go +++ b/transport/link.go @@ -1,6 +1,6 @@ package transport -import "github.com/xtls/xray-core/v1/common/buf" +import "github.com/xtls/xray-core/common/buf" // Link is a utility for connecting between an inbound and an outbound proxy handler. type Link struct { diff --git a/transport/pipe/impl.go b/transport/pipe/impl.go index b0011f2ba..4d0929f81 100644 --- a/transport/pipe/impl.go +++ b/transport/pipe/impl.go @@ -7,10 +7,10 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/signal/done" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/signal/done" ) type state byte diff --git a/transport/pipe/pipe.go b/transport/pipe/pipe.go index 45b004023..1706fdab7 100644 --- a/transport/pipe/pipe.go +++ b/transport/pipe/pipe.go @@ -3,9 +3,9 @@ package pipe import ( "context" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/features/policy" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/features/policy" ) // Option for creating new Pipes. diff --git a/transport/pipe/pipe_test.go b/transport/pipe/pipe_test.go index 446fb824c..a5cb25c58 100644 --- a/transport/pipe/pipe_test.go +++ b/transport/pipe/pipe_test.go @@ -9,9 +9,9 @@ import ( "github.com/google/go-cmp/cmp" "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/transport/pipe" ) func TestPipeReadWrite(t *testing.T) { diff --git a/transport/pipe/reader.go b/transport/pipe/reader.go index ba7221542..667334368 100644 --- a/transport/pipe/reader.go +++ b/transport/pipe/reader.go @@ -3,7 +3,7 @@ package pipe import ( "time" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) // Reader is a buf.Reader that reads content from a pipe. diff --git a/transport/pipe/writer.go b/transport/pipe/writer.go index a954fc9c5..8230ec760 100644 --- a/transport/pipe/writer.go +++ b/transport/pipe/writer.go @@ -1,7 +1,7 @@ package pipe import ( - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) // Writer is a buf.Writer that writes data into a pipe.