Showing preview only (5,975K chars total). Download the full file or copy to clipboard to get everything.
Repository: v2fly/v2ray-core
Branch: master
Commit: 2e97de9b4f26
Files: 1366
Total size: 5.5 MB
Directory structure:
gitextract_rgu_9fid/
├── .github/
│ ├── CODE_OF_CONDUCT.md
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_cn.md
│ │ ├── bug_en.md
│ │ └── other_en.md
│ ├── ISSUE_TEMPLATE.md
│ ├── dependabot.yml
│ └── workflows/
│ ├── codeql-analysis.yml
│ ├── linter.yml
│ ├── release.yml
│ ├── sign.yml
│ ├── stale.yml
│ └── test.yml
├── .gitignore
├── LICENSE
├── README.md
├── SECURITY.md
├── annotations.go
├── app/
│ ├── app.go
│ ├── browserforwarder/
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ └── forwarder.go
│ ├── commander/
│ │ ├── commander.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ ├── outbound.go
│ │ ├── service.go
│ │ └── webcommander/
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ └── webcommander.go
│ ├── dispatcher/
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── default.go
│ │ ├── dispatcher.go
│ │ ├── errors.generated.go
│ │ ├── fakednssniffer.go
│ │ ├── sniffer.go
│ │ ├── stats.go
│ │ └── stats_test.go
│ ├── dns/
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── dns.go
│ │ ├── dns_test.go
│ │ ├── dnscommon.go
│ │ ├── dnscommon_test.go
│ │ ├── errors.generated.go
│ │ ├── fakedns/
│ │ │ ├── errors.generated.go
│ │ │ ├── fake.go
│ │ │ ├── fakedns.go
│ │ │ ├── fakedns.pb.go
│ │ │ ├── fakedns.proto
│ │ │ └── fakedns_test.go
│ │ ├── fakedns.go
│ │ ├── fakedns_test.go
│ │ ├── hosts.go
│ │ ├── hosts_test.go
│ │ ├── nameserver.go
│ │ ├── nameserver_doh.go
│ │ ├── nameserver_doh_test.go
│ │ ├── nameserver_fakedns.go
│ │ ├── nameserver_local.go
│ │ ├── nameserver_local_test.go
│ │ ├── nameserver_quic.go
│ │ ├── nameserver_quic_test.go
│ │ ├── nameserver_tcp.go
│ │ ├── nameserver_tcp_test.go
│ │ └── nameserver_udp.go
│ ├── instman/
│ │ ├── command/
│ │ │ ├── command.go
│ │ │ ├── command.pb.go
│ │ │ ├── command.proto
│ │ │ └── command_grpc.pb.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ └── instman.go
│ ├── log/
│ │ ├── command/
│ │ │ ├── command.go
│ │ │ ├── command_test.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── config_grpc.pb.go
│ │ │ └── errors.generated.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ ├── log.go
│ │ ├── log_creator.go
│ │ └── log_test.go
│ ├── observatory/
│ │ ├── burst/
│ │ │ ├── burst.go
│ │ │ ├── burstobserver.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── errors.generated.go
│ │ │ ├── healthping.go
│ │ │ ├── healthping_result.go
│ │ │ ├── healthping_result_test.go
│ │ │ └── ping.go
│ │ ├── command/
│ │ │ ├── command.go
│ │ │ ├── command.pb.go
│ │ │ ├── command.proto
│ │ │ ├── command_grpc.pb.go
│ │ │ └── errors.generated.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ ├── explainErrors.go
│ │ ├── multiobservatory/
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ └── multi.go
│ │ ├── observatory.go
│ │ └── observer.go
│ ├── persistentstorage/
│ │ ├── filesystemstorage/
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ └── fs.go
│ │ ├── protostorage/
│ │ │ └── protokv.go
│ │ └── storage.go
│ ├── policy/
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ ├── manager.go
│ │ ├── manager_test.go
│ │ └── policy.go
│ ├── proxyman/
│ │ ├── command/
│ │ │ ├── command.go
│ │ │ ├── command.pb.go
│ │ │ ├── command.proto
│ │ │ ├── command_grpc.pb.go
│ │ │ ├── doc.go
│ │ │ └── errors.generated.go
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── inbound/
│ │ │ ├── always.go
│ │ │ ├── dynamic.go
│ │ │ ├── errors.generated.go
│ │ │ ├── inbound.go
│ │ │ └── worker.go
│ │ └── outbound/
│ │ ├── errors.generated.go
│ │ ├── handler.go
│ │ ├── handler_test.go
│ │ └── outbound.go
│ ├── restfulapi/
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ ├── restful_api.go
│ │ ├── service.go
│ │ └── service_test.go
│ ├── reverse/
│ │ ├── bridge.go
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ ├── portal.go
│ │ ├── portal_test.go
│ │ └── reverse.go
│ ├── router/
│ │ ├── balancing.go
│ │ ├── balancing_override.go
│ │ ├── command/
│ │ │ ├── command.go
│ │ │ ├── command.pb.go
│ │ │ ├── command.proto
│ │ │ ├── command_grpc.pb.go
│ │ │ ├── command_test.go
│ │ │ ├── config.go
│ │ │ └── errors.generated.go
│ │ ├── condition.go
│ │ ├── condition_geoip.go
│ │ ├── condition_geoip_test.go
│ │ ├── condition_test.go
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ ├── router.go
│ │ ├── router_test.go
│ │ ├── routercommon/
│ │ │ ├── common.pb.go
│ │ │ └── common.proto
│ │ ├── strategy_leastload.go
│ │ ├── strategy_leastload_test.go
│ │ ├── strategy_leastping.go
│ │ ├── strategy_random.go
│ │ ├── weight.go
│ │ └── weight_test.go
│ ├── stats/
│ │ ├── channel.go
│ │ ├── channel_test.go
│ │ ├── command/
│ │ │ ├── command.go
│ │ │ ├── command.pb.go
│ │ │ ├── command.proto
│ │ │ ├── command_grpc.pb.go
│ │ │ ├── command_test.go
│ │ │ └── errors.generated.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── counter.go
│ │ ├── counter_test.go
│ │ ├── errors.generated.go
│ │ ├── stats.go
│ │ └── stats_test.go
│ ├── subscription/
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── containers/
│ │ │ ├── base64urlline/
│ │ │ │ ├── base64urlline.go
│ │ │ │ ├── errors.generated.go
│ │ │ │ └── parser.go
│ │ │ ├── containers.go
│ │ │ ├── dataurlsingle/
│ │ │ │ ├── dataurl.go
│ │ │ │ └── errors.generated.go
│ │ │ ├── errors.generated.go
│ │ │ ├── jsonfieldarray/
│ │ │ │ ├── errors.generated.go
│ │ │ │ ├── jsonfieldarray.go
│ │ │ │ ├── jsonified/
│ │ │ │ │ ├── errors.generated.go
│ │ │ │ │ ├── jsonified.go
│ │ │ │ │ └── parser.go
│ │ │ │ └── parser.go
│ │ │ ├── tryall.go
│ │ │ └── urlline/
│ │ │ ├── errors.generated.go
│ │ │ ├── parser.go
│ │ │ └── urlline.go
│ │ ├── documentfetcher/
│ │ │ ├── dataurlfetcher/
│ │ │ │ ├── dataurl.go
│ │ │ │ └── errors.generated.go
│ │ │ ├── errors.generated.go
│ │ │ ├── fetcher.go
│ │ │ └── httpfetcher/
│ │ │ ├── errors.generated.go
│ │ │ └── http.go
│ │ ├── entries/
│ │ │ ├── entries.go
│ │ │ ├── errors.generated.go
│ │ │ ├── nonnative/
│ │ │ │ ├── converter.go
│ │ │ │ ├── definitions/
│ │ │ │ │ ├── shadowsocks.jsont
│ │ │ │ │ ├── shadowsocks2022.jsont
│ │ │ │ │ └── vmess.jsont
│ │ │ │ ├── errors.generated.go
│ │ │ │ ├── matchdef.go
│ │ │ │ ├── nonnative.go
│ │ │ │ └── nonnativeifce/
│ │ │ │ └── nonnativeifce.go
│ │ │ ├── outbound/
│ │ │ │ ├── errors.generated.go
│ │ │ │ └── outbound.go
│ │ │ └── register.go
│ │ ├── errors.generated.go
│ │ ├── specs/
│ │ │ ├── abstract_spec.pb.go
│ │ │ ├── abstract_spec.proto
│ │ │ ├── errors.generated.go
│ │ │ ├── outbound_parser.go
│ │ │ ├── skeleton.go
│ │ │ └── specs.go
│ │ ├── subscription.go
│ │ ├── subscription_rpc.pb.go
│ │ ├── subscription_rpc.proto
│ │ └── subscriptionmanager/
│ │ ├── command/
│ │ │ ├── command.go
│ │ │ ├── command.pb.go
│ │ │ ├── command.proto
│ │ │ ├── command_grpc.pb.go
│ │ │ └── errors.generated.go
│ │ ├── delta.go
│ │ ├── errors.generated.go
│ │ ├── known_metadata.go
│ │ ├── manager.go
│ │ ├── manager_rpc.go
│ │ ├── serverspec_materialize.go
│ │ ├── subdocapplier.go
│ │ ├── subdocchecker.go
│ │ ├── subdocupdater.go
│ │ └── tracked_subscription.go
│ └── tun/
│ ├── config.pb.go
│ ├── config.proto
│ ├── device/
│ │ ├── device.go
│ │ ├── errors.generated.go
│ │ ├── gvisor/
│ │ │ ├── errors.generated.go
│ │ │ ├── gvisor.go
│ │ │ ├── gvisor_linux.go
│ │ │ └── gvisor_others.go
│ │ └── linkWriterToWriter.go
│ ├── errors.generated.go
│ ├── handler.go
│ ├── handler_tcp.go
│ ├── handler_udp.go
│ ├── net/
│ │ └── net.go
│ ├── option.go
│ ├── packetaddradaptar.go
│ ├── packetparse/
│ │ ├── errors.generated.go
│ │ ├── packetParse.go
│ │ └── udp.go
│ ├── stack.go
│ ├── tun.go
│ └── tunsorter/
│ ├── errors.generated.go
│ └── tunsorter.go
├── common/
│ ├── antireplay/
│ │ ├── antireplay.go
│ │ ├── bloomring.go
│ │ └── replayfilter.go
│ ├── bitmask/
│ │ ├── byte.go
│ │ └── byte_test.go
│ ├── buf/
│ │ ├── buf.go
│ │ ├── buffer.go
│ │ ├── buffer_test.go
│ │ ├── copy.go
│ │ ├── copy_test.go
│ │ ├── errors.generated.go
│ │ ├── io.go
│ │ ├── io_test.go
│ │ ├── multi_buffer.go
│ │ ├── multi_buffer_test.go
│ │ ├── reader.go
│ │ ├── reader_test.go
│ │ ├── readv_posix.go
│ │ ├── readv_reader.go
│ │ ├── readv_reader_wasm.go
│ │ ├── readv_test.go
│ │ ├── readv_unix.go
│ │ ├── readv_windows.go
│ │ ├── writer.go
│ │ └── writer_test.go
│ ├── bytespool/
│ │ └── pool.go
│ ├── cache/
│ │ ├── lru.go
│ │ └── lru_test.go
│ ├── cmdarg/
│ │ ├── arg.go
│ │ ├── cmdarg.go
│ │ └── errors.generated.go
│ ├── common.go
│ ├── common_test.go
│ ├── crypto/
│ │ ├── aes.go
│ │ ├── auth.go
│ │ ├── auth_test.go
│ │ ├── benchmark_test.go
│ │ ├── chacha20.go
│ │ ├── chacha20_test.go
│ │ ├── chunk.go
│ │ ├── chunk_test.go
│ │ ├── crypto.go
│ │ ├── errors.generated.go
│ │ ├── internal/
│ │ │ ├── chacha.go
│ │ │ ├── chacha_core.generated.go
│ │ │ └── chacha_core_gen.go
│ │ └── io.go
│ ├── dice/
│ │ ├── dice.go
│ │ └── dice_test.go
│ ├── drain/
│ │ ├── drain.go
│ │ ├── drainer.go
│ │ └── errors.generated.go
│ ├── dualStack/
│ │ ├── fusedPacketConn/
│ │ │ └── fusedPacketSocket.go
│ │ └── happyEyeball/
│ │ └── racingDialer.go
│ ├── environment/
│ │ ├── app.go
│ │ ├── base.go
│ │ ├── connection.go
│ │ ├── deferredpersistentstorage/
│ │ │ └── defereredPersistentStorage.go
│ │ ├── envctx/
│ │ │ └── env.go
│ │ ├── envimpl/
│ │ │ └── fs.go
│ │ ├── filesystemcap/
│ │ │ └── fscap.go
│ │ ├── filesystemimpl/
│ │ │ └── fsimpl.go
│ │ ├── proxy.go
│ │ ├── rootcap.go
│ │ ├── rootcap_impl.go
│ │ ├── systemnetworkimpl/
│ │ │ └── systemnetwork.go
│ │ ├── transientstorageimpl/
│ │ │ ├── errors.generated.go
│ │ │ └── storage.go
│ │ └── transport.go
│ ├── errors/
│ │ ├── errors.go
│ │ ├── errors_test.go
│ │ └── multi_error.go
│ ├── errors.generated.go
│ ├── interfaces.go
│ ├── log/
│ │ ├── access.go
│ │ ├── log.go
│ │ ├── log.pb.go
│ │ ├── log.proto
│ │ ├── log_test.go
│ │ ├── logger.go
│ │ └── logger_test.go
│ ├── mux/
│ │ ├── client.go
│ │ ├── client_test.go
│ │ ├── errors.generated.go
│ │ ├── frame.go
│ │ ├── frame_test.go
│ │ ├── mux.go
│ │ ├── mux_test.go
│ │ ├── reader.go
│ │ ├── server.go
│ │ ├── session.go
│ │ ├── session_test.go
│ │ └── writer.go
│ ├── natTraversal/
│ │ └── stun/
│ │ ├── filteredStunConnection.go
│ │ ├── natTypeTest.go
│ │ ├── processor.go
│ │ ├── stunClientConn.go
│ │ └── stuncli/
│ │ └── stuncli.go
│ ├── net/
│ │ ├── abstactOutbount/
│ │ │ ├── errors.generated.go
│ │ │ └── outbound.go
│ │ ├── address.go
│ │ ├── address.pb.go
│ │ ├── address.proto
│ │ ├── address_test.go
│ │ ├── connection.go
│ │ ├── destination.go
│ │ ├── destination.pb.go
│ │ ├── destination.proto
│ │ ├── destination_test.go
│ │ ├── errors.generated.go
│ │ ├── net.go
│ │ ├── network.go
│ │ ├── network.pb.go
│ │ ├── network.proto
│ │ ├── packetaddr/
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── connection_adaptor.go
│ │ │ ├── packetaddr.go
│ │ │ ├── packetaddr_test.go
│ │ │ └── special_address.go
│ │ ├── port.go
│ │ ├── port.pb.go
│ │ ├── port.proto
│ │ ├── port_test.go
│ │ └── system.go
│ ├── packetswitch/
│ │ ├── gvisorstack/
│ │ │ ├── adapter.go
│ │ │ ├── adapter_test.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── dialer.go
│ │ │ ├── stack.go
│ │ │ └── tcp_listener.go
│ │ ├── interconnect/
│ │ │ ├── interconnect.go
│ │ │ ├── networkLayer_cable.go
│ │ │ └── networkLayer_cable_test.go
│ │ └── packetswitch.go
│ ├── peer/
│ │ ├── latency.go
│ │ └── peer.go
│ ├── platform/
│ │ ├── ctlcmd/
│ │ │ └── attr_other.go
│ │ ├── filesystem/
│ │ │ ├── file.go
│ │ │ └── fsifce/
│ │ │ └── ifce.go
│ │ ├── others.go
│ │ ├── platform.go
│ │ ├── platform_test.go
│ │ ├── securedload/
│ │ │ ├── embedded.go
│ │ │ ├── embeddedhash.go
│ │ │ ├── errors.generated.go
│ │ │ ├── file.go
│ │ │ ├── securedload.go
│ │ │ └── verify.go
│ │ └── windows.go
│ ├── protocol/
│ │ ├── account.go
│ │ ├── address.go
│ │ ├── address_test.go
│ │ ├── bittorrent/
│ │ │ └── bittorrent.go
│ │ ├── context.go
│ │ ├── dns/
│ │ │ ├── errors.generated.go
│ │ │ └── io.go
│ │ ├── errors.generated.go
│ │ ├── headers.go
│ │ ├── headers.pb.go
│ │ ├── headers.proto
│ │ ├── http/
│ │ │ ├── headers.go
│ │ │ ├── headers_test.go
│ │ │ ├── sniff.go
│ │ │ └── sniff_test.go
│ │ ├── id.go
│ │ ├── id_test.go
│ │ ├── payload.go
│ │ ├── protocol.go
│ │ ├── quic/
│ │ │ ├── cipher_suite.go
│ │ │ ├── sniff.go
│ │ │ └── sniff_test.go
│ │ ├── server_picker.go
│ │ ├── server_picker_test.go
│ │ ├── server_spec.go
│ │ ├── server_spec.pb.go
│ │ ├── server_spec.proto
│ │ ├── server_spec_test.go
│ │ ├── time.go
│ │ ├── time_test.go
│ │ ├── tls/
│ │ │ ├── cert/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── cert.go
│ │ │ │ ├── cert_test.go
│ │ │ │ ├── errors.generated.go
│ │ │ │ └── privateKey.go
│ │ │ ├── sniff.go
│ │ │ └── sniff_test.go
│ │ ├── udp/
│ │ │ ├── packet.go
│ │ │ └── udp.go
│ │ ├── user.go
│ │ ├── user.pb.go
│ │ └── user.proto
│ ├── protoext/
│ │ ├── errors.generated.go
│ │ ├── extensions.go
│ │ ├── extensions.pb.go
│ │ ├── extensions.proto
│ │ └── testing/
│ │ ├── extension_test.go
│ │ ├── test.pb.go
│ │ └── test.proto
│ ├── protofilter/
│ │ ├── errors.generated.go
│ │ └── filter.go
│ ├── registry/
│ │ ├── errors.generated.go
│ │ ├── implementation_set.go
│ │ ├── registry.go
│ │ └── restrict.go
│ ├── retry/
│ │ ├── errors.generated.go
│ │ ├── retry.go
│ │ └── retry_test.go
│ ├── serial/
│ │ ├── resolver.go
│ │ ├── serial.go
│ │ ├── serial_test.go
│ │ ├── string.go
│ │ ├── string_test.go
│ │ ├── typed_message.go
│ │ └── typed_message_test.go
│ ├── session/
│ │ ├── context.go
│ │ └── session.go
│ ├── signal/
│ │ ├── done/
│ │ │ └── done.go
│ │ ├── notifier.go
│ │ ├── notifier_test.go
│ │ ├── pubsub/
│ │ │ ├── pubsub.go
│ │ │ └── pubsub_test.go
│ │ ├── semaphore/
│ │ │ └── semaphore.go
│ │ ├── timer.go
│ │ └── timer_test.go
│ ├── strmatcher/
│ │ ├── benchmark_indexmatcher_test.go
│ │ ├── benchmark_matchers_test.go
│ │ ├── indexmatcher_linear.go
│ │ ├── indexmatcher_linear_test.go
│ │ ├── indexmatcher_mph.go
│ │ ├── indexmatcher_mph_test.go
│ │ ├── matchergroup_ac_automation.go
│ │ ├── matchergroup_ac_automation_test.go
│ │ ├── matchergroup_domain.go
│ │ ├── matchergroup_domain_test.go
│ │ ├── matchergroup_full.go
│ │ ├── matchergroup_full_test.go
│ │ ├── matchergroup_mph.go
│ │ ├── matchergroup_mph_test.go
│ │ ├── matchergroup_simple.go
│ │ ├── matchergroup_simple_test.go
│ │ ├── matchergroup_substr.go
│ │ ├── matchergroup_substr_test.go
│ │ ├── matchers.go
│ │ ├── matchers_test.go
│ │ └── strmatcher.go
│ ├── taggedfeatures/
│ │ ├── configloader.go
│ │ ├── creator.go
│ │ ├── errors.generated.go
│ │ ├── holder.go
│ │ ├── skeleton.pb.go
│ │ ├── skeleton.proto
│ │ └── taggedfeatures.go
│ ├── task/
│ │ ├── common.go
│ │ ├── periodic.go
│ │ ├── periodic_test.go
│ │ ├── task.go
│ │ ├── taskDerive/
│ │ │ ├── derive.go
│ │ │ ├── errors.generated.go
│ │ │ └── tryAll.go
│ │ └── task_test.go
│ ├── type.go
│ ├── type_test.go
│ ├── units/
│ │ ├── bytesize.go
│ │ └── bytesize_test.go
│ └── uuid/
│ ├── uuid.go
│ └── uuid_test.go
├── config.go
├── config.pb.go
├── config.proto
├── context.go
├── context_test.go
├── core.go
├── errors.generated.go
├── features/
│ ├── dns/
│ │ ├── client.go
│ │ ├── fakedns.go
│ │ └── localdns/
│ │ ├── client.go
│ │ └── errors.generated.go
│ ├── errors.generated.go
│ ├── extension/
│ │ ├── browser.go
│ │ ├── contextreceiver.go
│ │ ├── instance.go
│ │ ├── observatory.go
│ │ ├── storage/
│ │ │ └── storage.go
│ │ └── storage.go
│ ├── feature.go
│ ├── inbound/
│ │ └── inbound.go
│ ├── outbound/
│ │ └── outbound.go
│ ├── policy/
│ │ ├── default.go
│ │ └── policy.go
│ ├── routing/
│ │ ├── balancer.go
│ │ ├── context.go
│ │ ├── dispatcher.go
│ │ ├── dns/
│ │ │ ├── context.go
│ │ │ └── errors.generated.go
│ │ ├── router.go
│ │ └── session/
│ │ └── context.go
│ └── stats/
│ ├── errors.generated.go
│ └── stats.go
├── format.go
├── functions.go
├── functions_test.go
├── go.mod
├── go.sum
├── infra/
│ ├── conf/
│ │ ├── cfgcommon/
│ │ │ ├── buildable.go
│ │ │ ├── common.go
│ │ │ ├── common_test.go
│ │ │ ├── duration/
│ │ │ │ ├── duration.go
│ │ │ │ └── duration_test.go
│ │ │ ├── errors.generated.go
│ │ │ ├── loader/
│ │ │ │ ├── errors.generated.go
│ │ │ │ └── loader.go
│ │ │ ├── muxcfg/
│ │ │ │ └── mux.go
│ │ │ ├── proxycfg/
│ │ │ │ ├── errors.generated.go
│ │ │ │ └── proxy.go
│ │ │ ├── session.go
│ │ │ ├── sniffer/
│ │ │ │ ├── errors.generated.go
│ │ │ │ └── sniffer.go
│ │ │ ├── socketcfg/
│ │ │ │ └── socket.go
│ │ │ ├── testassist/
│ │ │ │ └── general.go
│ │ │ └── tlscfg/
│ │ │ ├── errors.generated.go
│ │ │ └── tls.go
│ │ ├── geodata/
│ │ │ ├── attr.go
│ │ │ ├── errors.generated.go
│ │ │ ├── geodata.go
│ │ │ ├── geodata_test.go
│ │ │ ├── geodataproto.go
│ │ │ ├── memconservative/
│ │ │ │ ├── cache.go
│ │ │ │ ├── decode.go
│ │ │ │ ├── decode_test.go
│ │ │ │ ├── errors.generated.go
│ │ │ │ └── memc.go
│ │ │ └── standard/
│ │ │ ├── errors.generated.go
│ │ │ └── standard.go
│ │ ├── json/
│ │ │ ├── json_test.go
│ │ │ ├── reader.go
│ │ │ ├── reader_test.go
│ │ │ ├── toml.go
│ │ │ ├── toml_test.go
│ │ │ ├── yaml.go
│ │ │ └── yaml_test.go
│ │ ├── jsonpb/
│ │ │ ├── errors.generated.go
│ │ │ └── jsonpb.go
│ │ ├── merge/
│ │ │ ├── errors.generated.go
│ │ │ ├── map.go
│ │ │ ├── merge.go
│ │ │ ├── merge_test.go
│ │ │ ├── priority.go
│ │ │ ├── rules.go
│ │ │ └── tag.go
│ │ ├── mergers/
│ │ │ ├── errors.generated.go
│ │ │ ├── extensions.go
│ │ │ ├── merge.go
│ │ │ ├── merger_base.go
│ │ │ ├── mergers.go
│ │ │ └── names.go
│ │ ├── rule/
│ │ │ ├── errors.generated.go
│ │ │ ├── rule.go
│ │ │ └── rule_test.go
│ │ ├── serial/
│ │ │ ├── errors.generated.go
│ │ │ ├── loader.go
│ │ │ ├── loader_test.go
│ │ │ └── serial.go
│ │ ├── synthetic/
│ │ │ ├── dns/
│ │ │ │ ├── dns.go
│ │ │ │ ├── dns_test.go
│ │ │ │ ├── errors.generated.go
│ │ │ │ └── fakedns.go
│ │ │ ├── log/
│ │ │ │ └── log.go
│ │ │ └── router/
│ │ │ ├── errors.generated.go
│ │ │ ├── router.go
│ │ │ ├── router_strategy.go
│ │ │ └── router_test.go
│ │ ├── v2jsonpb/
│ │ │ ├── any2.go
│ │ │ ├── errors.generated.go
│ │ │ ├── follower.go
│ │ │ ├── followerany.go
│ │ │ ├── followerlist.go
│ │ │ ├── followermap.go
│ │ │ └── v2jsonpb.go
│ │ ├── v4/
│ │ │ ├── api.go
│ │ │ ├── blackhole.go
│ │ │ ├── blackhole_test.go
│ │ │ ├── browser_forwarder.go
│ │ │ ├── conf.go
│ │ │ ├── dns_proxy.go
│ │ │ ├── dns_proxy_test.go
│ │ │ ├── dokodemo.go
│ │ │ ├── dokodemo_test.go
│ │ │ ├── errors.generated.go
│ │ │ ├── freedom.go
│ │ │ ├── freedom_test.go
│ │ │ ├── gun.go
│ │ │ ├── http.go
│ │ │ ├── http_test.go
│ │ │ ├── hysteria2.go
│ │ │ ├── lint.go
│ │ │ ├── loopback.go
│ │ │ ├── observatory.go
│ │ │ ├── policy.go
│ │ │ ├── policy_test.go
│ │ │ ├── reverse.go
│ │ │ ├── reverse_test.go
│ │ │ ├── services.go
│ │ │ ├── shadowsocks.go
│ │ │ ├── shadowsocks_test.go
│ │ │ ├── socks.go
│ │ │ ├── socks_test.go
│ │ │ ├── transport.go
│ │ │ ├── transport_authenticators.go
│ │ │ ├── transport_internet.go
│ │ │ ├── transport_test.go
│ │ │ ├── trojan.go
│ │ │ ├── v2ray.go
│ │ │ ├── v2ray_test.go
│ │ │ ├── vless.go
│ │ │ ├── vless_test.go
│ │ │ ├── vmess.go
│ │ │ └── vmess_test.go
│ │ └── v5cfg/
│ │ ├── common.go
│ │ ├── errors.generated.go
│ │ ├── inbound.go
│ │ ├── init.go
│ │ ├── outbound.go
│ │ ├── root.go
│ │ ├── skeleton.go
│ │ ├── stream.go
│ │ └── v5cfg.go
│ └── vformat/
│ └── main.go
├── main/
│ ├── commands/
│ │ ├── all/
│ │ │ ├── api/
│ │ │ │ ├── api.go
│ │ │ │ ├── balancer_info.go
│ │ │ │ ├── balancer_override.go
│ │ │ │ ├── jsonv4/
│ │ │ │ │ ├── inbounds_add.go
│ │ │ │ │ ├── inbounds_remove.go
│ │ │ │ │ ├── init.go
│ │ │ │ │ ├── outbounds_add.go
│ │ │ │ │ └── outbounds_remove.go
│ │ │ │ ├── log.go
│ │ │ │ ├── shared.go
│ │ │ │ └── stats.go
│ │ │ ├── commands.go
│ │ │ ├── engineering/
│ │ │ │ ├── convertpb.go
│ │ │ │ ├── encodedataurl.go
│ │ │ │ ├── engineering.go
│ │ │ │ ├── errors.generated.go
│ │ │ │ ├── generateRandomData/
│ │ │ │ │ ├── errors.generated.go
│ │ │ │ │ └── generateRandomData.go
│ │ │ │ ├── nonnativelinkexec.go
│ │ │ │ ├── nonnativelinkextract.go
│ │ │ │ ├── reversepb.go
│ │ │ │ └── subscriptionEntriesExtract.go
│ │ │ ├── errors.generated.go
│ │ │ ├── format_doc.go
│ │ │ ├── jsonv4/
│ │ │ │ ├── convert.go
│ │ │ │ └── init.go
│ │ │ ├── love.go
│ │ │ ├── merge_doc.go
│ │ │ ├── tls/
│ │ │ │ ├── cert.go
│ │ │ │ ├── chainhash.go
│ │ │ │ ├── ping.go
│ │ │ │ └── tls.go
│ │ │ ├── uuid.go
│ │ │ └── verify.go
│ │ ├── base/
│ │ │ ├── command.go
│ │ │ ├── env.go
│ │ │ ├── execute.go
│ │ │ ├── help.go
│ │ │ └── root.go
│ │ ├── errors.generated.go
│ │ ├── helpers/
│ │ │ ├── config_load.go
│ │ │ └── fs.go
│ │ ├── run.go
│ │ ├── test.go
│ │ └── version.go
│ ├── distro/
│ │ ├── all/
│ │ │ ├── all.go
│ │ │ ├── pion.go
│ │ │ └── wireguard.go
│ │ └── debug/
│ │ └── debug.go
│ ├── errors.generated.go
│ ├── formats/
│ │ ├── errors.generated.go
│ │ └── formats.go
│ ├── main.go
│ ├── main_test.go
│ ├── plugins/
│ │ ├── plugin.go
│ │ └── plugin_pprof/
│ │ └── plugin_pprof.go
│ └── v2binding/
│ ├── startUp.go
│ ├── v2api/
│ │ └── api.go
│ └── v2binding.go
├── mocks.go
├── proto.go
├── proxy/
│ ├── blackhole/
│ │ ├── blackhole.go
│ │ ├── blackhole_test.go
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── config_test.go
│ │ └── errors.generated.go
│ ├── dns/
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── dns.go
│ │ ├── dns_test.go
│ │ └── errors.generated.go
│ ├── dokodemo/
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── dokodemo.go
│ │ └── errors.generated.go
│ ├── freedom/
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ └── freedom.go
│ ├── http/
│ │ ├── client.go
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ ├── http.go
│ │ ├── server.go
│ │ └── simplified/
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ └── config.proto
│ ├── hysteria2/
│ │ ├── client.go
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ ├── hysteria2.go
│ │ ├── protocol.go
│ │ └── server.go
│ ├── loopback/
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ └── loopback.go
│ ├── proxy.go
│ ├── shadowsocks/
│ │ ├── client.go
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── config_test.go
│ │ ├── errors.generated.go
│ │ ├── protocol.go
│ │ ├── protocol_test.go
│ │ ├── server.go
│ │ ├── shadowsocks.go
│ │ └── simplified/
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ └── errors.generated.go
│ ├── shadowsocks2022/
│ │ ├── client.go
│ │ ├── client_session.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── eih_aes.go
│ │ ├── encoding.go
│ │ ├── errors.generated.go
│ │ ├── kdf_blake3.go
│ │ ├── method_aes128gcm.go
│ │ ├── method_aes256gcm.go
│ │ ├── requestsalt.go
│ │ ├── ss2022.go
│ │ └── udp_aes.go
│ ├── socks/
│ │ ├── client.go
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ ├── protocol.go
│ │ ├── protocol_test.go
│ │ ├── server.go
│ │ ├── simplified/
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ └── config.proto
│ │ └── socks.go
│ ├── trojan/
│ │ ├── client.go
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ ├── protocol.go
│ │ ├── protocol_test.go
│ │ ├── server.go
│ │ ├── simplified/
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ └── config.proto
│ │ ├── trojan.go
│ │ └── validator.go
│ ├── vless/
│ │ ├── account.go
│ │ ├── account.pb.go
│ │ ├── account.proto
│ │ ├── encoding/
│ │ │ ├── addons.go
│ │ │ ├── addons.pb.go
│ │ │ ├── addons.proto
│ │ │ ├── encoding.go
│ │ │ ├── encoding_test.go
│ │ │ └── errors.generated.go
│ │ ├── errors.generated.go
│ │ ├── inbound/
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── errors.generated.go
│ │ │ └── inbound.go
│ │ ├── outbound/
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── errors.generated.go
│ │ │ └── outbound.go
│ │ ├── validator.go
│ │ └── vless.go
│ ├── vlite/
│ │ ├── inbound/
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── connAdp.go
│ │ │ ├── errors.generated.go
│ │ │ └── inbound.go
│ │ ├── outbound/
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── errors.generated.go
│ │ │ └── outbound.go
│ │ └── vlite.go
│ ├── vmess/
│ │ ├── account.go
│ │ ├── account.pb.go
│ │ ├── account.proto
│ │ ├── aead/
│ │ │ ├── authid.go
│ │ │ ├── authid_test.go
│ │ │ ├── consts.go
│ │ │ ├── encrypt.go
│ │ │ ├── encrypt_test.go
│ │ │ ├── kdf.go
│ │ │ └── kdf_test.go
│ │ ├── encoding/
│ │ │ ├── auth.go
│ │ │ ├── auth_test.go
│ │ │ ├── client.go
│ │ │ ├── commands.go
│ │ │ ├── commands_test.go
│ │ │ ├── encoding.go
│ │ │ ├── encoding_test.go
│ │ │ ├── errors.generated.go
│ │ │ └── server.go
│ │ ├── errors.generated.go
│ │ ├── inbound/
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── errors.generated.go
│ │ │ └── inbound.go
│ │ ├── outbound/
│ │ │ ├── command.go
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── errors.generated.go
│ │ │ └── outbound.go
│ │ ├── validator.go
│ │ ├── validator_test.go
│ │ ├── vmess.go
│ │ └── vmessCtxInterface.go
│ └── wireguard/
│ ├── outbound/
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── errors.generated.go
│ │ └── outbound.go
│ └── wgcommon/
│ ├── config.pb.go
│ ├── config.proto
│ ├── errors.generated.go
│ ├── filterDebug.go
│ ├── setup.go
│ ├── wgConnAdaptor.go
│ ├── wgConnAdaptor_test.go
│ ├── wgDeviceAdaptor.go
│ ├── wgDeviceAdaptor_test.go
│ ├── wgLogAdaptor.go
│ ├── wgcommon.go
│ └── wgdevice.go
├── release/
│ ├── config/
│ │ ├── config.json
│ │ ├── systemd/
│ │ │ └── system/
│ │ │ ├── v2ray.service
│ │ │ └── v2ray@.service
│ │ ├── vpoint_socks_vmess.json
│ │ └── vpoint_vmess_freedom.json
│ ├── container/
│ │ ├── Containerfile
│ │ └── downloadAssets.sh
│ ├── debian/
│ │ ├── changelog
│ │ ├── control
│ │ ├── copyright
│ │ ├── rules
│ │ ├── source/
│ │ │ └── format
│ │ ├── v2ray-docs.docs
│ │ ├── v2ray-domain-list-community.install
│ │ ├── v2ray-geoip-only-cn-private.install
│ │ ├── v2ray-geoip.install
│ │ ├── v2ray.install
│ │ ├── v2ray.service
│ │ └── v2ray@.service
│ ├── extra/
│ │ └── browserforwarder/
│ │ ├── index.html
│ │ └── index.js
│ ├── friendly-filenames.json
│ ├── install-release.sh
│ ├── requestsign.sh
│ └── user-package.sh
├── testing/
│ ├── mocks/
│ │ ├── dns.go
│ │ ├── io.go
│ │ ├── log.go
│ │ ├── mux.go
│ │ ├── outbound.go
│ │ └── proxy.go
│ ├── scenarios/
│ │ ├── cert/
│ │ │ ├── self-signed_cert.pem
│ │ │ └── self-signed_key.pem
│ │ ├── command_test.go
│ │ ├── common.go
│ │ ├── common_coverage.go
│ │ ├── common_instanceMgr.go
│ │ ├── common_instanceMgr_test.go
│ │ ├── common_regular.go
│ │ ├── config/
│ │ │ ├── grpc_client.json
│ │ │ ├── grpc_server.json
│ │ │ ├── grpc_servicename_client.json
│ │ │ ├── grpc_servicename_server.json
│ │ │ ├── httpupgrade_client.json
│ │ │ ├── httpupgrade_earlydataShortEarlyData_client.json
│ │ │ ├── httpupgrade_earlydataShortEarlyData_server.json
│ │ │ ├── httpupgrade_earlydata_client.json
│ │ │ ├── httpupgrade_earlydata_server.json
│ │ │ ├── httpupgrade_server.json
│ │ │ ├── meek_client.json
│ │ │ ├── meek_server.json
│ │ │ ├── mekya_client.json
│ │ │ └── mekya_server.json
│ │ ├── dns_test.go
│ │ ├── dokodemo_test.go
│ │ ├── feature_test.go
│ │ ├── grpc_test.go
│ │ ├── http_test.go
│ │ ├── httpupgrade_test.go
│ │ ├── hy2_test.go
│ │ ├── meek_test.go
│ │ ├── mekya_test.go
│ │ ├── policy_test.go
│ │ ├── reverse_test.go
│ │ ├── shadowsocks_test.go
│ │ ├── socks_test.go
│ │ ├── tls_test.go
│ │ ├── transport_test.go
│ │ └── vmess_test.go
│ └── servers/
│ ├── http/
│ │ └── http.go
│ ├── tcp/
│ │ ├── port.go
│ │ └── tcp.go
│ └── udp/
│ ├── port.go
│ └── udp.go
├── transport/
│ ├── config.go
│ ├── config.pb.go
│ ├── config.proto
│ ├── internet/
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── connection.go
│ │ ├── dialer.go
│ │ ├── dialer_test.go
│ │ ├── domainsocket/
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── dial.go
│ │ │ ├── errgen.go
│ │ │ ├── errors.generated.go
│ │ │ ├── listener.go
│ │ │ └── listener_test.go
│ │ ├── dtls/
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── dialer.go
│ │ │ ├── dtls.go
│ │ │ ├── errors.generated.go
│ │ │ └── listener.go
│ │ ├── errors.generated.go
│ │ ├── filelocker.go
│ │ ├── filelocker_other.go
│ │ ├── filelocker_windows.go
│ │ ├── grpc/
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── dial.go
│ │ │ ├── encoding/
│ │ │ │ ├── conn.go
│ │ │ │ ├── customSeviceName.go
│ │ │ │ ├── encoding.go
│ │ │ │ ├── errors.generated.go
│ │ │ │ ├── stream.pb.go
│ │ │ │ ├── stream.proto
│ │ │ │ └── stream_grpc.pb.go
│ │ │ ├── errors.generated.go
│ │ │ ├── grpc.go
│ │ │ └── hub.go
│ │ ├── header.go
│ │ ├── header_test.go
│ │ ├── headers/
│ │ │ ├── http/
│ │ │ │ ├── config.go
│ │ │ │ ├── config.pb.go
│ │ │ │ ├── config.proto
│ │ │ │ ├── errors.generated.go
│ │ │ │ ├── http.go
│ │ │ │ ├── http_test.go
│ │ │ │ ├── linkedreadRequest.go
│ │ │ │ └── resp.go
│ │ │ ├── noop/
│ │ │ │ ├── config.pb.go
│ │ │ │ ├── config.proto
│ │ │ │ └── noop.go
│ │ │ ├── srtp/
│ │ │ │ ├── config.pb.go
│ │ │ │ ├── config.proto
│ │ │ │ ├── srtp.go
│ │ │ │ └── srtp_test.go
│ │ │ ├── tls/
│ │ │ │ ├── config.pb.go
│ │ │ │ ├── config.proto
│ │ │ │ ├── dtls.go
│ │ │ │ └── dtls_test.go
│ │ │ ├── utp/
│ │ │ │ ├── config.pb.go
│ │ │ │ ├── config.proto
│ │ │ │ ├── utp.go
│ │ │ │ └── utp_test.go
│ │ │ ├── wechat/
│ │ │ │ ├── config.pb.go
│ │ │ │ ├── config.proto
│ │ │ │ ├── wechat.go
│ │ │ │ └── wechat_test.go
│ │ │ └── wireguard/
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ └── wireguard.go
│ │ ├── http/
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── dialer.go
│ │ │ ├── errors.generated.go
│ │ │ ├── http.go
│ │ │ ├── http_test.go
│ │ │ └── hub.go
│ │ ├── httpupgrade/
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── connection.go
│ │ │ ├── dialer.go
│ │ │ ├── errors.generated.go
│ │ │ ├── httpupgrade.go
│ │ │ └── hub.go
│ │ ├── hysteria2/
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── conn.go
│ │ │ ├── dialer.go
│ │ │ ├── errors.generated.go
│ │ │ ├── hub.go
│ │ │ ├── hy2_transport_test.go
│ │ │ └── hysteria2.go
│ │ ├── internet.go
│ │ ├── kcp/
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── connection.go
│ │ │ ├── connection_test.go
│ │ │ ├── crypt.go
│ │ │ ├── crypt_test.go
│ │ │ ├── cryptreal.go
│ │ │ ├── dialer.go
│ │ │ ├── errors.generated.go
│ │ │ ├── io.go
│ │ │ ├── io_test.go
│ │ │ ├── kcp.go
│ │ │ ├── kcp_test.go
│ │ │ ├── listener.go
│ │ │ ├── output.go
│ │ │ ├── receiving.go
│ │ │ ├── segment.go
│ │ │ ├── segment_test.go
│ │ │ ├── sending.go
│ │ │ ├── xor.go
│ │ │ ├── xor_amd64.go
│ │ │ └── xor_amd64.s
│ │ ├── memory_settings.go
│ │ ├── quic/
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── conn.go
│ │ │ ├── dialer.go
│ │ │ ├── errors.generated.go
│ │ │ ├── hub.go
│ │ │ ├── pool.go
│ │ │ ├── quic.go
│ │ │ └── quic_test.go
│ │ ├── request/
│ │ │ ├── assembler/
│ │ │ │ ├── packetconn/
│ │ │ │ │ ├── errors.generated.go
│ │ │ │ │ ├── packetConn.pb.go
│ │ │ │ │ ├── packetConn.proto
│ │ │ │ │ ├── packetbundle.go
│ │ │ │ │ ├── packetconn.go
│ │ │ │ │ ├── req2packet.go
│ │ │ │ │ ├── udpassembler.go
│ │ │ │ │ ├── udpassemblerClient.go
│ │ │ │ │ └── udpassemblerServer.go
│ │ │ │ └── simple/
│ │ │ │ ├── client.go
│ │ │ │ ├── config.pb.go
│ │ │ │ ├── config.proto
│ │ │ │ ├── errors.generated.go
│ │ │ │ ├── server.go
│ │ │ │ └── simple.go
│ │ │ ├── assembler.go
│ │ │ ├── assembly/
│ │ │ │ ├── assembly.go
│ │ │ │ ├── config.pb.go
│ │ │ │ ├── config.proto
│ │ │ │ ├── dialer.go
│ │ │ │ ├── errors.generated.go
│ │ │ │ └── hub.go
│ │ │ ├── options.go
│ │ │ ├── request.go
│ │ │ ├── reverser.go
│ │ │ ├── roundtripper/
│ │ │ │ └── httprt/
│ │ │ │ ├── config.pb.go
│ │ │ │ ├── config.proto
│ │ │ │ ├── errors.generated.go
│ │ │ │ └── httprt.go
│ │ │ ├── roundtripper.go
│ │ │ ├── roundtripperreverserserver/
│ │ │ │ ├── accesschecker_password.go
│ │ │ │ ├── accesschecker_password_test.go
│ │ │ │ ├── clicommand/
│ │ │ │ │ ├── errors.generated.go
│ │ │ │ │ ├── generate_token_cli.go
│ │ │ │ │ └── roundTripperReserseServerCli.go
│ │ │ │ ├── config.pb.go
│ │ │ │ ├── config.proto
│ │ │ │ ├── errors.generated.go
│ │ │ │ ├── reverser.go
│ │ │ │ ├── reverserimpl.go
│ │ │ │ └── reverserimpl_test.go
│ │ │ └── stereotype/
│ │ │ ├── meek/
│ │ │ │ ├── config.pb.go
│ │ │ │ ├── config.proto
│ │ │ │ ├── errors.generated.go
│ │ │ │ └── meek.go
│ │ │ └── mekya/
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── errors.generated.go
│ │ │ └── mekya.go
│ │ ├── security/
│ │ │ ├── connprop.go
│ │ │ ├── errors.generated.go
│ │ │ ├── security.go
│ │ │ └── util.go
│ │ ├── socket_activation_other.go
│ │ ├── socket_activation_unix.go
│ │ ├── sockopt.go
│ │ ├── sockopt_darwin.go
│ │ ├── sockopt_freebsd.go
│ │ ├── sockopt_linux.go
│ │ ├── sockopt_linux_test.go
│ │ ├── sockopt_other.go
│ │ ├── sockopt_test.go
│ │ ├── sockopt_windows.go
│ │ ├── system_dialer.go
│ │ ├── system_dns_android.go
│ │ ├── system_dns_android_test.go
│ │ ├── system_listener.go
│ │ ├── system_listener_test.go
│ │ ├── tagged/
│ │ │ ├── tagged.go
│ │ │ └── taggedimpl/
│ │ │ ├── errors.generated.go
│ │ │ ├── impl.go
│ │ │ └── taggedimpl.go
│ │ ├── tcp/
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── dialer.go
│ │ │ ├── errors.generated.go
│ │ │ ├── hub.go
│ │ │ ├── sockopt_freebsd.go
│ │ │ ├── sockopt_linux.go
│ │ │ ├── sockopt_linux_test.go
│ │ │ ├── sockopt_other.go
│ │ │ └── tcp.go
│ │ ├── tcp_hub.go
│ │ ├── tls/
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── config_other.go
│ │ │ ├── config_test.go
│ │ │ ├── config_windows.go
│ │ │ ├── ech.go
│ │ │ ├── ech_go122.go
│ │ │ ├── engine.go
│ │ │ ├── errors.generated.go
│ │ │ ├── pin.go
│ │ │ ├── pin_test.go
│ │ │ ├── tls.go
│ │ │ └── utls/
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── errors.generated.go
│ │ │ ├── nameMapper.go
│ │ │ └── utls.go
│ │ ├── tlsmirror/
│ │ │ ├── data.pb.go
│ │ │ ├── data.proto
│ │ │ ├── httponconnection/
│ │ │ │ ├── errors.generated.go
│ │ │ │ └── singleconnhttp.go
│ │ │ ├── interface.go
│ │ │ ├── mirrorbase/
│ │ │ │ ├── base.go
│ │ │ │ ├── conn.go
│ │ │ │ ├── crypto.go
│ │ │ │ ├── crypto_test.go
│ │ │ │ └── errors.generated.go
│ │ │ ├── mirrorcommon/
│ │ │ │ ├── handshake.go
│ │ │ │ ├── loopback_protect.go
│ │ │ │ ├── record.go
│ │ │ │ ├── record_consts.go
│ │ │ │ └── recordstream.go
│ │ │ ├── mirrorcrypto/
│ │ │ │ ├── decryptor.go
│ │ │ │ ├── derive_key.go
│ │ │ │ ├── encrypter.go
│ │ │ │ ├── errors.generated.go
│ │ │ │ ├── mirrorcrypto.go
│ │ │ │ ├── tls_cipher_suites.go
│ │ │ │ └── tls_cipher_suites_linkname.go
│ │ │ ├── mirrorenrollment/
│ │ │ │ ├── cancelContextOnCloseConn.go
│ │ │ │ ├── clicommand/
│ │ │ │ │ └── enrollmentlink_cli.go
│ │ │ │ ├── client.go
│ │ │ │ ├── config.pb.go
│ │ │ │ ├── config.proto
│ │ │ │ ├── enrollment.go
│ │ │ │ ├── enrollmentlink.go
│ │ │ │ ├── enrollmentlink_test.go
│ │ │ │ ├── errors.generated.go
│ │ │ │ ├── httpenrollmentconfirmation/
│ │ │ │ │ ├── client.go
│ │ │ │ │ ├── clientbuilder.go
│ │ │ │ │ ├── enrollment.go
│ │ │ │ │ ├── errors.generated.go
│ │ │ │ │ ├── hub.go
│ │ │ │ │ └── server.go
│ │ │ │ ├── keyderivation.go
│ │ │ │ ├── roundtripperenrollmentconfirmation/
│ │ │ │ │ ├── client.go
│ │ │ │ │ ├── config.pb.go
│ │ │ │ │ ├── config.proto
│ │ │ │ │ ├── errors.generated.go
│ │ │ │ │ ├── rttconfirmation.go
│ │ │ │ │ ├── server.go
│ │ │ │ │ └── serverinverserole.go
│ │ │ │ ├── server.go
│ │ │ │ └── serverenrollmentprocessor.go
│ │ │ ├── server/
│ │ │ │ ├── ciphersuits_lookup.go
│ │ │ │ ├── client.go
│ │ │ │ ├── client_conn.go
│ │ │ │ ├── config.pb.go
│ │ │ │ ├── config.proto
│ │ │ │ ├── conn.go
│ │ │ │ ├── errors.generated.go
│ │ │ │ ├── hub.go
│ │ │ │ ├── outbound.go
│ │ │ │ ├── padding.go
│ │ │ │ └── server.go
│ │ │ └── tlstrafficgen/
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── errors.generated.go
│ │ │ └── trafficgen.go
│ │ ├── transportcommon/
│ │ │ ├── dialer.go
│ │ │ ├── errors.generated.go
│ │ │ ├── httpDialer.go
│ │ │ ├── listener.go
│ │ │ └── tansportcommon.go
│ │ ├── udp/
│ │ │ ├── config.go
│ │ │ ├── config.pb.go
│ │ │ ├── config.proto
│ │ │ ├── copy.go
│ │ │ ├── dialer.go
│ │ │ ├── dispatcher.go
│ │ │ ├── dispatcher_packetaddr.go
│ │ │ ├── dispatcher_split.go
│ │ │ ├── dispatcher_split_test.go
│ │ │ ├── errors.generated.go
│ │ │ ├── hub.go
│ │ │ ├── hub_freebsd.go
│ │ │ ├── hub_linux.go
│ │ │ ├── hub_other.go
│ │ │ ├── monodest.go
│ │ │ └── udp.go
│ │ └── websocket/
│ │ ├── config.go
│ │ ├── config.pb.go
│ │ ├── config.proto
│ │ ├── connection.go
│ │ ├── connforwarder.go
│ │ ├── dialer.go
│ │ ├── errors.generated.go
│ │ ├── hub.go
│ │ ├── ws.go
│ │ └── ws_test.go
│ ├── link.go
│ └── pipe/
│ ├── impl.go
│ ├── pipe.go
│ ├── pipe_test.go
│ ├── reader.go
│ └── writer.go
├── v2ray.go
└── v2ray_test.go
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
conduct@v2fly.org.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
================================================
FILE: .github/ISSUE_TEMPLATE/bug_cn.md
================================================
---
name: V2Ray 程序问题
about: "提交一个 V2Ray 的程序问题报告。"
---
<!--
除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚如何配置,请在 https://github.com/v2fly/v2ray-core/discussions 进行讨论。
-->
## 你正在使用哪个版本的 V2Ray?
<!-- 如果服务端和客户端使用了不同版本,请注明 -->
## 你的使用场景是什么?
<!-- 比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频 -->
## 你看到的异常现象是什么?
<!-- 请描述具体现象,比如访问超时、TLS 证书错误等 -->
## 你期待看到的正常表现是怎样的?
## 请附上你的配置
<!-- 提交 issue 前,请隐去服务器域名或 IP 地址 -->
**服务端配置:**
```javascript
// 在这里附上服务器端配置文件
```
**客户端配置:**
```javascript
// 在这里附上客户端配置
```
## 请附上出错时软件输出的错误日志
<!-- 在 Linux 中,日志通常在 `/var/log/v2ray/error.log` 文件中 -->
**服务器端错误日志:**
```javascript
// 在这里附上服务器端日志
```
**客户端错误日志:**
```javascript
// 在这里附上客户端日志
```
## 请附上访问日志
<!-- 在 Linux 中,访问日志通常在 `/var/log/v2ray/access.log` 文件中 -->
```javascript
// 在这里附上服务器端日志
```
## 其它相关的配置文件(如 Nginx)和相关日志
## 如果 V2Ray 无法启动,请附上 `--test` 命令的输出
## 如果 V2Ray 服务运行异常,请附上 journal 日志
<!-- 通常的命令为 `journalctl -u v2ray` -->
<!-- 请预览一下你填写的内容并整理好格式后,再提交 -->
================================================
FILE: .github/ISSUE_TEMPLATE/bug_en.md
================================================
---
name: Bug report
about: "Create a bug report to help us improve"
---
<!--
Please answer all the questions with enough information. All issues not following this template will be closed immediately.
If you are not sure if your question is truely a bug of V2Ray, please discuss it at https://github.com/v2fly/v2ray-core/discussions first.
-->
## What version of V2Ray are you using?
<!-- If you deploy different versions of V2Ray on server and client, please explicitly point out -->
## What's your scenario of using V2Ray?
<!-- E.g., watching YouTube videos in browsers via Socks/VMess proxy -->
## What problems have you encountered?
<!-- Please describe in detail, such as timeout, fake TLS certificate, etc -->
## What's your expectation?
## Please attach your configuration here
<!-- Remember to mask your IP address or hostname -->
**Server configuration:**
```javascript
// Please attach your server configuration here.
```
**Client configuration:**
```javascript
// Please attach your client configuration here.
```
## Please attach error logs here
<!--
only trailing lines if the log file is large in size.
Error log file is usually at `/var/log/v2ray/error.log` on Linux.
-->
**Server error log:**
```javascript
// Please attach your server error log here.
```
**Client error log:**
```javascript
// Please attach your client error log here.
```
## Please attach access log here
<!-- Access log is usually at '/var/log/v2ray/access.log' on Linux. -->
```javascript
// Please attach your server access log here.
```
## Other configurations (such as Nginx) and logs here
## If V2Ray cannot start up, please attach output from `--test` command
## If V2Ray service is abnormal, please attach journal log here
<!-- Usual command is `journalctl -u v2ray` -->
<!-- Please review your issue and check the format before submitting. -->
================================================
FILE: .github/ISSUE_TEMPLATE/other_en.md
================================================
---
name: Other
about: "其它问题请使用 https://github.com/v2fly/v2ray-core/discussions 进行讨论 / Please discuss other issues at https://github.com/v2fly/v2ray-core/discussions"
---
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用[Discussion](https://github.com/v2fly/v2ray-core/discussions)进行讨论。
此 Issue 会被立即关闭。
If you are not sure if your question is truely a bug in V2Ray, please discuss it [here](https://github.com/v2fly/v2ray-core/discussions) first.
This issue will be closed immediately.
================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用[Discussion](https://github.com/v2fly/discussion/issues)进行讨论。
此 Issue 会被立即关闭。
If you are not sure if your question is truely a bug in V2Ray, please discuss it [here](https://github.com/v2fly/discussion/issues) first.
This issue will be closed immediately.
================================================
FILE: .github/dependabot.yml
================================================
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
================================================
FILE: .github/workflows/codeql-analysis.yml
================================================
name: CodeQL
on:
push:
branches: [master]
pull_request:
branches: [master]
types: [opened, synchronize, reopened]
paths-ignore:
- "**/*.md"
- "**/*.txt"
jobs:
analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: ["go"]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: autobuild
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
================================================
FILE: .github/workflows/linter.yml
================================================
name: Linter
on:
push:
branches:
- master
- v*
paths:
- "**/*.go"
- ".github/workflows/linter.yml"
pull_request:
types: [opened, synchronize, reopened]
paths:
- "**/*.go"
- ".github/workflows/linter.yml"
jobs:
lint:
if: github.repository == 'v2fly/v2ray-core'
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: ./go.mod
cache-dependency-path: ./go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
args: --config=.github/linters/.golangci.yml
only-new-issues: true
================================================
FILE: .github/workflows/release.yml
================================================
name: Release
on:
release:
types:
- prereleased
- released
push:
branches:
- master
- v*
- dev*
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/release.yml"
pull_request:
types: [opened, synchronize, reopened]
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/release.yml"
jobs:
build:
strategy:
matrix:
# Include amd64 on all platforms.
goos: [windows, freebsd, openbsd, linux, dragonfly, darwin]
goarch: [amd64, 386]
exclude:
# Exclude i386 on darwin and dragonfly.
- goarch: 386
goos: dragonfly
- goarch: 386
goos: darwin
- goarch: amd64
goos: linux
include:
# BEGIN Linux ARM 5 6 7
- goos: linux
goarch: arm
goarm: 7
- goos: linux
goarch: arm
goarm: 6
- goos: linux
goarch: arm
goarm: 5
# END Linux ARM 5 6 7
# BEGIN Windows ARM 7
# - goos: windows
# goarch: arm
# goarm: 7
# END Windows ARM 7
# BEGIN FreeBSD ARM 6 7
- goos: freebsd
goarch: arm
goarm: 6
- goos: freebsd
goarch: arm
goarm: 7
# END FreeBSD ARM 6 7
# BEGIN OpenBSD ARM 6 7
- goos: openbsd
goarch: arm
goarm: 6
- goos: openbsd
goarch: arm
goarm: 7
# END OpenBSD ARM 6 7
# BEGIN Other architectures
- goos: darwin
goarch: arm64
- goos: linux
goarch: arm64
- goos: linux
goarch: riscv64
- goos: linux
goarch: loong64
- goos: windows
goarch: arm64
- goos: android
goarch: arm64
- goos: freebsd
goarch: arm64
- goos: openbsd
goarch: arm64
# BEGIN MIPS
- goos: linux
goarch: mips64
- goos: linux
goarch: mips64le
- goos: linux
goarch: mipsle
- goos: linux
goarch: mips
- goos: linux
goarch: arm64
pie: pie
- goos: linux
goarch: amd64
pie: pie
- goos: linux
goarch: amd64
pie:
# END MIPS
# END Other architectures
fail-fast: false
runs-on: ubuntu-latest
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
PIE_ENABLED: ${{ matrix.pie }}
CGO_ENABLED: 0
IS_PRERELEASE: ${{ github.event.release.prerelease }}
steps:
- name: Checkout codebase
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Show workflow information
id: get_filename
run: |
export _NAME=$(jq ".[\"$GOOS-$GOARCH$GOARM$PIE_ENABLED\"].friendlyName" -r < release/friendly-filenames.json)
if [ "$GOARCH" = "arm64" ] && [ "$PIE_ENABLED" = "pie" ] && [ "$IS_PRERELEASE" = "true" ]; then
export _NAME="${_NAME}-prerelease"
fi
echo "GOOS: $GOOS, GOARCH: $GOARCH, GOARM: $GOARM, RELEASE_NAME: $_NAME"
echo "ASSET_NAME=$_NAME" >> $GITHUB_OUTPUT
echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: ./go.mod
cache-dependency-path: ./go.sum
- name: Get project dependencies
run: go mod download
- name: Build V2Ray
run: |
mkdir -p build_assets
EXTRA_ARG=""
case "$GOOS-$GOARCH" in
"linux-amd64")
;&
"linux-arm64")
if [ ! -z $PIE_ENABLED ]
then
EXTRA_ARG=$EXTRA_ARG" -buildmode=pie"
fi
;;
esac
go build $EXTRA_ARG -v -o build_assets/v2ray -trimpath -ldflags "-s -w -buildid=" ./main
- name: Rename Windows V2Ray
if: matrix.goos == 'windows'
run: |
cd ./build_assets || exit 1
mv v2ray v2ray.exe
- name: Download geo files
run: |
wget -O release/config/geoip.dat "https://raw.githubusercontent.com/v2fly/geoip/release/geoip.dat"
wget -O release/config/geoip-only-cn-private.dat "https://raw.githubusercontent.com/v2fly/geoip/release/geoip-only-cn-private.dat"
wget -O release/config/geosite.dat "https://raw.githubusercontent.com/v2fly/domain-list-community/release/dlc.dat"
- name: Prepare package
run: cp -v ./release/config/*.* ./build_assets
- name: Prepare package for Linux
if: matrix.goos == 'linux'
run: cp -rv ./release/config/systemd ./build_assets/
- name: Create ZIP archive
run: |
pushd build_assets || exit 1
zip -9vr ../v2ray-$ASSET_NAME.zip .
popd || exit 1
FILE=./v2ray-$ASSET_NAME.zip
DGST=$FILE.dgst
openssl dgst -md5 $FILE | sed 's/([^)]*)//g' >>$DGST
openssl dgst -sha1 $FILE | sed 's/([^)]*)//g' >>$DGST
openssl dgst -sha256 $FILE | sed 's/([^)]*)//g' >>$DGST
openssl dgst -sha512 $FILE | sed 's/([^)]*)//g' >>$DGST
- name: Upload ZIP file to Artifacts
uses: actions/upload-artifact@v7
with:
name: v2ray-${{ steps.get_filename.outputs.ASSET_NAME }}.zip
path: v2ray-${{ steps.get_filename.outputs.ASSET_NAME }}.zip
- name: Upload files to GitHub release
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: ./v2ray-${{ steps.get_filename.outputs.ASSET_NAME }}.zip*
tag: ${{ github.ref }}
overwrite: true
signature:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout codebase
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: ./go.mod
cache-dependency-path: ./go.sum
- uses: actions/download-artifact@v8
with:
path: build_artifacts
- name: Create extra package
run: |
pushd ./release/extra/
zip -9vr ../../build_artifacts/v2ray-extra.zip .
popd
- name: Generate shasum
run: |
go get -v github.com/v2fly/V2BuildAssist/v2buildutil
cd build_artifacts || exit 1
mkdir .temp
mv ./*/*.zip ./.temp
rmdir ./*/
mv ./.temp/* .
ls -lah --recursive
{
go run github.com/v2fly/V2BuildAssist/v2buildutil gen version $(git describe --tags $(git rev-list --tags --max-count=1))
go run github.com/v2fly/V2BuildAssist/v2buildutil gen project "v2fly"
for zip in $(ls *.zip); do
go run github.com/v2fly/V2BuildAssist/v2buildutil gen file ${zip}
done
} >Release.unsigned.unsorted
go run github.com/v2fly/V2BuildAssist/v2buildutil gen sort < Release.unsigned.unsorted > Release.unsigned
rm -f Release.unsigned.unsorted
FILE=./Release.unsigned
DGST=$FILE.dgst
openssl dgst -md5 $FILE | sed 's/([^)]*)//g' >>$DGST
openssl dgst -sha1 $FILE | sed 's/([^)]*)//g' >>$DGST
openssl dgst -sha256 $FILE | sed 's/([^)]*)//g' >>$DGST
openssl dgst -sha512 $FILE | sed 's/([^)]*)//g' >>$DGST
- uses: actions/upload-artifact@v7
with:
name: Release.unsigned
path: build_artifacts/Release.unsigned
- uses: actions/upload-artifact@v7
with:
name: Release.unsigned.dgst
path: build_artifacts/Release.unsigned.dgst
- uses: actions/upload-artifact@v7
with:
name: v2ray-extra.zip
path: build_artifacts/v2ray-extra.zip
- name: Upload Release.unsigned related files
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: build_artifacts/Release.unsigned*
tag: ${{ github.ref }}
overwrite: true
- name: Upload extra package
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: build_artifacts/v2ray-extra.zip
tag: ${{ github.ref }}
overwrite: true
buildContainer:
if: github.event_name == 'release'
needs: signature
name: Build And Push image
runs-on: ubuntu-latest
env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
RELEASE_REPO: ${{ github.repository }}
VERSION: ${{ github.event.release.tag_name }}
TIMESTAMP: ${{ github.event.release.created_at }}
PRERELEASE: ${{ github.event.release.prerelease }}
VARIANTS: | # <v2ray variant>:<image tag suffix>
std:
extra:-extra
ARCHS: | # <v2ray arch name>:<container arch name>
32:386
64:amd64
arm32-v6:arm/v6
arm32-v7a:arm/v7
arm64-v8a:arm64
arm64-v8a:arm64/v8
steps:
- uses: actions/checkout@v6
- name: Log in to ghcr.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
registry: ${{ env.IMAGE_REGISTRY }}
- name: Build Images
id: build-image
run: |
image=v2ray
tags=
timestamp=$(date -d $TIMESTAMP +%s)
versions="$VERSION" # full version (v1.2.3)
versions="$versions $(echo $VERSION | cut -d. -f1,2)" # minor version (v1.2)
if [ $PRERELEASE = false ]; then
versions="$versions $(echo $VERSION | cut -d. -f1)" # major version (v1)
versions="$versions latest"
fi
formatEach() {
format=$1
shift 1
echo "$@" | xargs -n1 | xargs -i echo "$format" | xargs
}
for variant in $VARIANTS; do
v2Variant=$(echo $variant | cut -d: -f1)
containerVariant=$(echo $variant | cut -d: -f2)
variantTags=$(formatEach "{}$containerVariant" $versions)
tags="$tags $variantTags"
for arch in $ARCHS; do
v2Arch=$(echo $arch | cut -d: -f1)
containerArch=$(echo $arch | cut -d: -f2)
bash ./release/container/downloadAssets.sh $VERSION $v2Arch $containerArch $v2Variant
for tag in $variantTags; do
buildah bud \
--manifest $image:$tag \
--file ./release/container/Containerfile \
--platform linux/$containerArch \
--timestamp $timestamp \
--squash \
./context/linux/$containerArch/$v2Variant
done
done
done
echo image=$image >> $GITHUB_OUTPUT
echo tags=$tags >> $GITHUB_OUTPUT
- name: Push To ghcr.io
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
================================================
FILE: .github/workflows/sign.yml
================================================
name: Sign
on:
release:
types: [released]
jobs:
sign:
runs-on: ubuntu-latest
steps:
- name: Checkout default branch
uses: actions/checkout@v6
- name: Grant it execution permission
run: |
chmod +x $GITHUB_WORKSPACE/release/requestsign.sh
- name: Invoke release signing
env:
SIGN_SERVICE_PASSWORD: ${{ secrets.SIGN_SERVICE_PASSWORD }}
SIGN_SERIVCE_URL: ${{ secrets.SIGN_SERIVCE_URL_V5 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export SIGN_VERSION=$(cat $GITHUB_EVENT_PATH| jq -r ".release.tag_name")
echo $SIGN_VERSION
$GITHUB_WORKSPACE/release/requestsign.sh
================================================
FILE: .github/workflows/stale.yml
================================================
name: Mark stale issues and pull requests
on:
schedule:
- cron: "30 1 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v10
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: "This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days"
stale-pr-message: "It has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days"
days-before-stale: 120
days-before-close: 5
exempt-pr-labels: "planned"
================================================
FILE: .github/workflows/test.yml
================================================
name: Test
on:
push:
branches:
- master
- v*
- dev*
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/test.yml"
pull_request:
types: [opened, synchronize, reopened]
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/test.yml"
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- name: Checkout codebase
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: ./go.mod
cache-dependency-path: ./go.sum
- name: Check Go modules
run: |
go mod tidy
git diff --exit-code go.mod go.sum
go mod verify
- name: Run tests with coverage report
run: |
go test ./... -v -timeout=1h -coverprofile=coverage.out -covermode=atomic
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: runner.os == 'Linux'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
slug: ${{ github.repository }}
verbose: true
fail_ci_if_error: true
================================================
FILE: .gitignore
================================================
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
*.DS_Store
.idea
*.zip
*.tar.gz
v2ray
v2ctl
mockgen
vprotogen
!infra/vprotogen/
errorgen
!common/errors/errorgen/
*.dat
*~
[._]*.un~
.golangci.yml
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2015-2025 V2Fly Community
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
<div>
<img width="190" height="210" align="left" src="https://raw.githubusercontent.com/v2fly/v2fly-github-io/master/docs/.vuepress/public/readme-logo.png" alt="V2Ray"/>
<br>
<h1>Project V</h1>
<p>Project V is a set of network tools that helps you to build your own computer network. It secures your network connections and thus protects your privacy.</p>
</div>
[](https://github.com/v2fly/v2ray-core/actions/workflows/test.yml)
[](https://codecov.io/gh/v2fly/v2ray-core?branch=master)
[](https://goreportcard.com/report/github.com/v2fly/v2ray-core/v5)
[](https://app.codacy.com/gh/v2fly/v2ray-core/dashboard)
[](https://github.com/v2fly/v2ray-core/releases/latest)
## Related Links
- [Documentation](https://www.v2fly.org) and [Newcomer's Instructions](https://www.v2fly.org/guide/start.html)
- Welcome to translate V2Ray documents via [Transifex](https://www.transifex.com/v2fly/public/)
## Packaging Status
> If you are willing to package V2Ray for other distros/platforms, please let us know or seek for help via [GitHub issues](https://github.com/v2fly/v2ray-core/issues).
[](https://repology.org/project/v2ray/versions)
## License
[The MIT License (MIT)](https://raw.githubusercontent.com/v2fly/v2ray-core/master/LICENSE)
## Credits
This repo relies on the following third-party projects:
- In production:
- [gorilla/websocket](https://github.com/gorilla/websocket)
- [quic-go/quic-go](https://github.com/quic-go/quic-go)
- [pires/go-proxyproto](https://github.com/pires/go-proxyproto)
- [seiflotfy/cuckoofilter](https://github.com/seiflotfy/cuckoofilter)
- [google/starlark-go](https://github.com/google/starlark-go)
- [jhump/protoreflect](https://github.com/jhump/protoreflect)
- [inetaf/netaddr](https://github.com/inetaf/netaddr)
- For testing only:
- [miekg/dns](https://github.com/miekg/dns)
- [h12w/socks](https://github.com/h12w/socks)
================================================
FILE: SECURITY.md
================================================
# 安全策略 Security Policy
## 受支持的版本 Supported Versions
目前 v2ray-core 项目由 [V2Fly 社区](https://github.com/v2fly) 继续提供代码维护,由于精力有限且项目复杂度较高,只维护主线代码的功能和安全性完整。原则上主页的兼容性保证继续遵循,
如有例外另行说明。
Currently v2ray-core project is maintained by [V2Fly community](https://github.com/v2fly). Feature and security guarantee may only be limited to the
master branch, though we would still try our best to follow the compatibility claims listed on the official website.
## 汇报安全风险 Reporting a Vulnerability
使用邮箱: security |at| v2fly.org。
Report to email: security |at| v2fly.org.
GPG public key:
```
pub rsa4096 2020-06-02 [SC] [有效至:2022-01-02]
E2E35E27914FB007C0D4B6DDB117BA3BE8B494A7
uid [ 绝对 ] V2Fly Developers <dev@v2fly.org>
sub rsa4096 2020-06-02 [E] [有效至:2022-01-02]
sub rsa4096 2020-11-08 [S] [有效至:2022-01-02] // 用于 Debian / Ubuntu 签名
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBF7V7pQBEACozcw4/BlPgFWaz4AdN8HKSrCDLlN+/g7m4AKZIo13fAnDh+sJ
2H4NrWNr0xxgovbco5Xw4OSSwY1BuUhnb4AmIyxbwqUQD2UADe5xD6gMBwNiJTP4
02VCHhh7DnWTeLbAsUgRotxUCxsWVvd2F08SYGfJggOVftOnG+VNnwzTOvHWFVEw
1Pv1DaY7bKSA0voACerRbAPCYqhmElAGJHYNjBMaxqCaWFJWpAFfBxkvS1FDVyZk
BsABhn6sOcGJn8EYSHUIXhWwqtkQCjBB4OOik+Jn+S2DFGyk5l1NrGRQtX8C0BYn
nc7VaxtFOp5fnJ4y0GNd4AM9KO0/Ojosi6b64l407Fj9i9OXznmZUACQw2u+VcL3
qNy768hsTmka3pXzpRHZwYcOLOEr3jGHmLOtXgQ656OjF8Xd9DJ4cB42X8iBeqTp
iQchHIdBpnu27ZbBFy09OMak+STB5zA0JmxDaC8b48mVkc0BMRXdYl7wWXJsEJf1
roAOr3RCBKiE840w0PLOTnUljfqazPYTwzs91oP+SeZjBmGOpaAh7bh5BVOpzPSE
bdA61/n01GEb5bpOKpaTi9GviF3RCbfFnLKJnBq0vHvW9BqKTVFRPAKkBGuOPBdy
8MBNY+VY/2aP3ukZUoYe8Ypl9Q7dVPRjnoWaH0sEMzftoh+3s7GSSgAylQARAQAB
tCBWMkZseSBEZXZlbG9wZXJzIDxkZXZAdjJmbHkub3JnPokCVAQTAQgAPgIbAwUL
CQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBOLjXieRT7AHwNS23bEXujvotJSnBQJf
p4leBQkC+1DKAAoJELEXujvotJSn124P/0swu9POvEQtxVlRzNh2VjAGHZ5NEDnl
pMrhfC5ryCYtlVS/kc2WwRhIRHKzr9nbamgSxUCiyLagfnIjhIvAohun49grYNzG
MZWRURiuFrCnYbD7juJTvfbzZCzJk7LPsdnqHWr8fYcOZMTOZVzQiQB2jUx2KeRm
yV8aV21Z8gMLqSGjs06a0UaRbKB0FSysTURm91/jFmiH43aG1s/LcB9/lKf5HpNl
9or6LrEOrokAwtkMSBYTqm7Dp1j+cK0iOMw2CmMqmQZkV+i6msYrQRiX/X6YufiM
wfMMSdOZOz9KG+k+C6N1swSbGeDMrJfnDUDbvrAXKhDjNgY7UBwbk69Abd7Y9aQz
/jVmrFEWt4lisBxglBot60CRUTM2boK/uQS5zBCJhemeg14F9Q/FRiUTlS8jQoeK
PWeK2lagYJS8lpJZLXkqe4xSpjCgoT0Z+lYSfTjx+T0AFF+xz5E243Lb5kDxwnR9
Y5CZt3vV6GWBYOt9MEL3pk7AnYyNT1y1KIiMyONh/Z1koUdHr4J9exllnsmAJQUa
W/j0UtVsLsvUjFv9RTr9w5p/U0J0VLIN0YOpx4wYaBEwFIa8lsL+Ey1Vphkvvjfz
uMRAHe4v+axWb1f1hVCBjtyCVyvzf+i9RTAYsBJ3MJ0C8cvvrm10N9B7MHh0JZA5
PcJSilailp1TuQINBF7V7pQBEADkQdO75smeKnmPt0/aNNlb7JDOSWW5VY0kYgx3
6Toh139JstIQ2xz0CLSGReizUFB6eR3DXmezLrmhkgN2Aq5A+hCtFAJwWKuKr1HS
usvJ1el9h0oh7IO+tF8E/gNYwWfabjPX27FGVCHR1qG7ffN51Bghrnwi1T4YC98E
R9EGU6N0Xs9DeIJL9WQPH/DF22251i/OAXkqKVGn3PNe2cBsp0yKxr9mlSyzjrha
KXokPiPcvNqlnkiDCgfiRj7c2C2Lyl9PoEiGpsNZaCZYkMPgjM0xiLenQddwRyOU
z2cLG3d8WdCTRyHSZd/YQtSi5R6AnkJEsVtUiDN5zwNFVpQlTq3jNHsVUpjFU2nK
ourTZVCCLbAC60VTdxLN6eFO0f+lS2WjyJ7uZ9SGbS6uP0jMNphH/QjVF848bWXs
1CuZty5QQY7+MTNUAhSWWntrpTkdXYqT0zUqiOc1YNnkfg3hvC4d0dbnFTfcyZnB
Sg8e7/9n6+ms75/deYgnLuA6h7pkIcflm7pUMfVKXKz5Vlc8FC9ia0UtobeKBKqi
jObfiO/zmNL0HQBeX0e8GkJrCyv6ikD8cUqsmVtgw7jdxGsV0SL5CddDnGKsc68O
pGDmkAuRqR3QtXju/4r7a8IEVveGWc3rUvddYrtqbbCNWCN0JKX13PEvbNAm+2eD
MGQtcQARAQABiQI8BBgBCAAmAhsMFiEE4uNeJ5FPsAfA1LbdsRe6O+i0lKcFAl+n
dwcFCQL7PnMACgkQsRe6O+i0lKeWfxAApopL5I9p4btmkcLIg2lkA1n+czFekbdr
2tjFKrBER4QWkyDCUE8QaVo/ECveTHmnxrTB/djW6xqPVS77PL8xOATIYTo6qU38
oTCB1T7/P2L9qI72BzcRY5f9ZPyJhCtrkvjCPzjUjw+ZIPIOgQcWgKHWnE+OyUKD
0GkVEUME3QP5S4Nr3XGrgS7oxDAmD52u7pn0mSk5WmEcLW0oGwsVdc4aDXxpX+u/
gkBZysmAuomPov7iXVosMakl+4rz30yPcrL9A81m1WAeB3PGkpaO3B++8Ql+FBCQ
OrLtPn/nnIzEuAXB1Hd8vYzxtRM2CZvhRExM7xofnhkBJOtR/ddfbJa7H5+Aruc0
4S0JIaqMCrC6tZezjTACAzrWULmZZGmrHbLrmXBuLk0huRkeIRnDzHP+DoE2UciL
3hR9EGOHX9O/dGb3bb3y11LAf7GI28ZG7So1GeoFkEOga1IJnsBnXCqwM8vbDDWq
/7aLb3/m0gT7DUfjeXKfWPJXcnaq8r4llHzDn2i6ax4Uq/brCOLj9ovVGIctZTbt
yvsFOc1bVkSuUM+pMkCtBx80/sJSB2Nu94S6osdaUlRE+jaCcqEbPd+G68Yd0Khi
CL8zF1a3dX1dpuVFTLNpXOgrviGBzXQmzFeil7mWFs0l+1XZOPz9nhmRrMn6wV3n
i4KItRSJAXy5Ag0EX6d5hQEQAMsVyLTXdybeei2nWDb5jtzzC3AtSnPWtKG4B86C
BXncaZpU43hKI3oduW2+42eM8n8KTvO11r9xv4zKATfaHBZq2hkKZdDQjuSstovr
a3hapHHknHeNVTg3yuiakKzpr6FK23W/GE1lJfhz254v9+dRV0KazWksXvpGEdgI
+6sC4Nr5bKgJVEQibyrrL0gmzlVB/oQU/W4eGvk21zmgMlHri+edBLpVtlCmn7k/
0t+2X9D1Pq2nkjMUurB9EJ1z24LMldmPOl6P7iJCx9kSUjcHrEg56q5VSZq50FAj
DeSjAqsdussI8cdstCMktE9nhizxVKFXpbXifqoYfJwCo23wFqQJpyPgQqHIT12s
GWRUa/MF6hRYg/5CyeadDmkmnKPTPjmQ2S2SFNXX7xs+dZKvIvXP30z4cpuVY8i8
chZSRNb8K0L9T0Jme7CPm28F6lvDUkNDQ1WErXZruHbOKwQOfQBdXK3nedOiUpBt
401HVlGUJSInfEb3JXU01tRqnnzI/y5z7cWCGEMEa6TeaCrMbVvl8xeAA1w/nw0y
zHz6/Pnf4TITuCH22aa7+xfgpq8gRLhUUws89mbQT+9fd8tT65+Q8xcaLCyzrLAq
zND5sVZ4/PwaYc8UNZcHjeQR7aYWI1xgr/IwY1wyDWZLbWgkk0HVxpvYdMEpJryD
AyMdABEBAAGJBHIEGAEIACYWIQTi414nkU+wB8DUtt2xF7o76LSUpwUCX6d5hQIb
AgUJAim2AAJACRCxF7o76LSUp8F0IAQZAQgAHRYhBK8FZLGpNMztuW02YbJOz+X/
ddOBBQJfp3mFAAoJELJOz+X/ddOBNKQP/0nwIC4R9gQhY53vME7VA7elIrBiSM6d
Va26a7J1nrCcpDAE7Lp0TqzrDMqyen+IL4X5QK5sKTgenYTgjppEJIQn+Wup54ix
I+YOQ8MVLfN6/3QPACWMngSPRF+UKDg4hyTCEL+/GCgTp58oXrl/YIO6Oqt5drog
w4+4ufU1/eKTb2ruGULGl9jZvFSZpLdsvJ19xJB2kC1k8GVNu7MnUL+S2pU/9kO4
5EZ/jEa1wT45zev+HdmzX5TYW6SLaI9HKHMqbQz2EHc3tRYIDaz3FE3s4VdMjqpp
e42SvkOYaguc6cXToDbzBmU+iWGlXCTHfNhxwxoUYcKZlDEkEtvSYHJOb0k9eqbT
gvMb5GjbAgqqwOBwtN3v790j8jEG+cdXR3qHcEx0bw3F2Bd18U7j946OxHLKE5Xk
2sWEG422maVrE9o1DdeTV5oDFNNPBzqfjgGBZCCKrjkpldhDOHeoDU2aFMJ7yVqw
ZwKwJ5f8fdNS13UnQVwGsZ2BsW1cox5ZGZ/C5A7mfSF1WAgJcYIw4M2JQbDn4Yuw
yqjyg53lT3OurBONbEZ7unnsLqpT9qKwZ1qCemqGRJieXXxJwl7G4gBgZbH0rBJR
6dhbyt4c2JE8MMdC65mDWneltNM6pttC/j5jCuvIlZGACZ91UuLLediJJWAlOJ+1
fBQ0m8TD6d8ZrakP/RFMLZrxh9WPaFB43sW/b1Fq2h933HQ29oSQFuXhsHsx1Vaq
HTRTcBB7kywAr9+zMYsOsk0/WnoZNGoMkUWu/gFkb6CdUcsdEumgyZ8S24VoBCHB
T1fD/8eOA5K82hwAFcKbPwuuTLtf9b9HB4/xsObfcczTeqIknzIPsGlgVz4w1c9a
StSo4iI4bCSLL+/mqiXZ+ArXJ/z4Vejl92fNLWVOlOrjkBV+AY6iAFCCsxJ1O5ud
5a5r1bUeBXd0BcQ1m/hpjawMC1y0SkIBTQCgxIQoPoxJ27hHNIN1R2nkqfY9vboQ
7O0uIHF8fmuz93xg68ZTW0JHwOw4Mz88lGibE2laHApjKWZAtF/i+LlhbnewtESL
EuGTT7gt7cSHgnBiDEIm5UJVEGeM0sMReztxy9V7glohH5DV8GpVK/GncKlsrh1K
BuEuz7IrqKlBzhsDy0SrNZpX7EzsiU1uvoA6teT4EPey8qXH+7WR9B2ad1Zc5yE3
zv4BpnWkkJp8qdYu4fdCs/mrmnBR5G1YdOAIlNWhU74Wdyq+W4HfTWMgvJHmElnZ
UvQ9RDTWnw2+3n2ATeLf9ZwW1g4/Dqh55OaLtJZo5me8vU9W+vkm34xzfVfD/mus
ljogw5eiGyj8j3lUVjYWu28l/bz0zDUueWmHhV8E8z0Cn7OhrHPpUCHx2Aep
=quYd
-----END PGP PUBLIC KEY BLOCK-----
```
================================================
FILE: annotations.go
================================================
package core
// Annotation is a concept in V2Ray. This struct is only for documentation. It is not used anywhere.
// Annotations begin with "v2ray:" in comment, as metadata of functions or types.
type Annotation struct {
// API is for types or functions that can be used in other libs. Possible values are:
//
// * v2ray:api:beta for types or functions that are ready for use, but maybe changed in the future.
// * v2ray:api:stable for types or functions with guarantee of backward compatibility.
// * v2ray:api:deprecated for types or functions that should not be used anymore.
//
// Types or functions without api annotation should not be used externally.
API string
}
================================================
FILE: app/app.go
================================================
// Package app contains feature implementations of V2Ray. The features may be enabled during runtime.
package app
================================================
FILE: app/browserforwarder/config.pb.go
================================================
package browserforwarder
import (
_ "github.com/v2fly/v2ray-core/v5/common/protoext"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Config is the settings for BrowserForwarder.
type Config struct {
state protoimpl.MessageState `protogen:"open.v1"`
ListenAddr string `protobuf:"bytes,1,opt,name=listen_addr,json=listenAddr,proto3" json:"listen_addr,omitempty"`
ListenPort int32 `protobuf:"varint,2,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Config) Reset() {
*x = Config{}
mi := &file_app_browserforwarder_config_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Config) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Config) ProtoMessage() {}
func (x *Config) ProtoReflect() protoreflect.Message {
mi := &file_app_browserforwarder_config_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Config.ProtoReflect.Descriptor instead.
func (*Config) Descriptor() ([]byte, []int) {
return file_app_browserforwarder_config_proto_rawDescGZIP(), []int{0}
}
func (x *Config) GetListenAddr() string {
if x != nil {
return x.ListenAddr
}
return ""
}
func (x *Config) GetListenPort() int32 {
if x != nil {
return x.ListenPort
}
return 0
}
var File_app_browserforwarder_config_proto protoreflect.FileDescriptor
const file_app_browserforwarder_config_proto_rawDesc = "" +
"\n" +
"!app/browserforwarder/config.proto\x12\x1fv2ray.core.app.browserforwarder\x1a common/protoext/extensions.proto\"b\n" +
"\x06Config\x12\x1f\n" +
"\vlisten_addr\x18\x01 \x01(\tR\n" +
"listenAddr\x12\x1f\n" +
"\vlisten_port\x18\x02 \x01(\x05R\n" +
"listenPort:\x16\x82\xb5\x18\x12\n" +
"\aservice\x12\abrowserB~\n" +
"#com.v2ray.core.app.browserforwarderP\x01Z3github.com/v2fly/v2ray-core/v5/app/browserforwarder\xaa\x02\x1fV2Ray.Core.App.Browserforwarderb\x06proto3"
var (
file_app_browserforwarder_config_proto_rawDescOnce sync.Once
file_app_browserforwarder_config_proto_rawDescData []byte
)
func file_app_browserforwarder_config_proto_rawDescGZIP() []byte {
file_app_browserforwarder_config_proto_rawDescOnce.Do(func() {
file_app_browserforwarder_config_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_app_browserforwarder_config_proto_rawDesc), len(file_app_browserforwarder_config_proto_rawDesc)))
})
return file_app_browserforwarder_config_proto_rawDescData
}
var file_app_browserforwarder_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_app_browserforwarder_config_proto_goTypes = []any{
(*Config)(nil), // 0: v2ray.core.app.browserforwarder.Config
}
var file_app_browserforwarder_config_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_app_browserforwarder_config_proto_init() }
func file_app_browserforwarder_config_proto_init() {
if File_app_browserforwarder_config_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_app_browserforwarder_config_proto_rawDesc), len(file_app_browserforwarder_config_proto_rawDesc)),
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_app_browserforwarder_config_proto_goTypes,
DependencyIndexes: file_app_browserforwarder_config_proto_depIdxs,
MessageInfos: file_app_browserforwarder_config_proto_msgTypes,
}.Build()
File_app_browserforwarder_config_proto = out.File
file_app_browserforwarder_config_proto_goTypes = nil
file_app_browserforwarder_config_proto_depIdxs = nil
}
================================================
FILE: app/browserforwarder/config.proto
================================================
syntax = "proto3";
package v2ray.core.app.browserforwarder;
option csharp_namespace = "V2Ray.Core.App.Browserforwarder";
option go_package = "github.com/v2fly/v2ray-core/v5/app/browserforwarder";
option java_package = "com.v2ray.core.app.browserforwarder";
option java_multiple_files = true;
import "common/protoext/extensions.proto";
// Config is the settings for BrowserForwarder.
message Config {
option (v2ray.core.common.protoext.message_opt).type = "service";
option (v2ray.core.common.protoext.message_opt).short_name = "browser";
string listen_addr = 1;
int32 listen_port = 2;
}
================================================
FILE: app/browserforwarder/errors.generated.go
================================================
package browserforwarder
import "github.com/v2fly/v2ray-core/v5/common/errors"
type errPathObjHolder struct{}
func newError(values ...interface{}) *errors.Error {
return errors.New(values...).WithPathObj(errPathObjHolder{})
}
================================================
FILE: app/browserforwarder/forwarder.go
================================================
package browserforwarder
import (
"bytes"
"context"
"io"
"net/http"
"strings"
"time"
"github.com/v2fly/BrowserBridge/handler"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/net"
"github.com/v2fly/v2ray-core/v5/common/platform/securedload"
"github.com/v2fly/v2ray-core/v5/features/extension"
"github.com/v2fly/v2ray-core/v5/transport/internet"
)
//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen
type Forwarder struct {
ctx context.Context
forwarder *handler.HTTPHandle
httpserver *http.Server
config *Config
}
func (f *Forwarder) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
requestPath := request.URL.Path[1:]
switch requestPath {
case "":
fallthrough
case "index.js":
BridgeResource(writer, request, requestPath)
case "link":
f.forwarder.ServeBridge(writer, request)
}
}
func (f *Forwarder) DialWebsocket(url string, header http.Header) (io.ReadWriteCloser, error) {
protocolHeader := false
protocolHeaderValue := ""
unsupportedHeader := false
for k, v := range header {
if k == "Sec-Websocket-Protocol" {
protocolHeader = true
protocolHeaderValue = v[0]
} else {
unsupportedHeader = true
}
}
if unsupportedHeader {
return nil, newError("unsupported header used, only Sec-Websocket-Protocol is supported for forwarder")
}
if !protocolHeader {
return f.forwarder.Dial(url)
}
return f.forwarder.Dial2(url, protocolHeaderValue)
}
func (f *Forwarder) Type() interface{} {
return extension.BrowserForwarderType()
}
func (f *Forwarder) Start() error {
if f.config.ListenAddr != "" {
f.forwarder = handler.NewHttpHandle()
f.httpserver = &http.Server{Handler: f}
var listener net.Listener
var err error
address := net.ParseAddress(f.config.ListenAddr)
switch {
case address.Family().IsIP():
listener, err = internet.ListenSystem(f.ctx, &net.TCPAddr{IP: address.IP(), Port: int(f.config.ListenPort)}, nil)
case strings.EqualFold(address.Domain(), "localhost"):
listener, err = internet.ListenSystem(f.ctx, &net.TCPAddr{IP: net.IP{127, 0, 0, 1}, Port: int(f.config.ListenPort)}, nil)
default:
return newError("forwarder cannot listen on the address: ", address)
}
if err != nil {
return newError("forwarder cannot listen on the port ", f.config.ListenPort).Base(err)
}
go func() {
if err := f.httpserver.Serve(listener); err != nil {
newError("cannot serve http forward server").Base(err).WriteToLog()
}
}()
}
return nil
}
func (f *Forwarder) Close() error {
if f.httpserver != nil {
return f.httpserver.Close()
}
return nil
}
func BridgeResource(rw http.ResponseWriter, r *http.Request, path string) {
content := path
if content == "" {
content = "index.html"
}
data, err := securedload.GetAssetSecured("browserforwarder/" + content)
if err != nil {
err = newError("cannot load necessary resources").Base(err)
http.Error(rw, err.Error(), http.StatusForbidden)
return
}
http.ServeContent(rw, r, path, time.Now(), bytes.NewReader(data))
}
func NewForwarder(ctx context.Context, cfg *Config) *Forwarder {
return &Forwarder{config: cfg, ctx: ctx}
}
func init() {
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, cfg interface{}) (interface{}, error) {
return NewForwarder(ctx, cfg.(*Config)), nil
}))
}
================================================
FILE: app/commander/commander.go
================================================
package commander
//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen
import (
"context"
"net"
"sync"
"google.golang.org/grpc"
core "github.com/v2fly/v2ray-core/v5"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/serial"
"github.com/v2fly/v2ray-core/v5/common/signal/done"
"github.com/v2fly/v2ray-core/v5/features"
"github.com/v2fly/v2ray-core/v5/features/outbound"
"github.com/v2fly/v2ray-core/v5/infra/conf/v5cfg"
)
type CommanderIfce interface {
features.Feature
ExtractGrpcServer() *grpc.Server
}
// Commander is a V2Ray feature that provides gRPC methods to external clients.
type Commander struct {
sync.Mutex
server *grpc.Server
services []Service
ohm outbound.Manager
tag string
}
// NewCommander creates a new Commander based on the given config.
func NewCommander(ctx context.Context, config *Config) (*Commander, error) {
c := &Commander{
tag: config.Tag,
}
common.Must(core.RequireFeatures(ctx, func(om outbound.Manager) {
c.ohm = om
}))
for _, rawConfig := range config.Service {
config, err := serial.GetInstanceOf(rawConfig)
if err != nil {
return nil, err
}
rawService, err := common.CreateObject(ctx, config)
if err != nil {
return nil, err
}
service, ok := rawService.(Service)
if !ok {
return nil, newError("not a Service.")
}
c.services = append(c.services, service)
}
return c, nil
}
// Type implements common.HasType.
func (c *Commander) Type() interface{} {
return (*CommanderIfce)(nil)
}
// Start implements common.Runnable.
func (c *Commander) Start() error {
c.Lock()
c.server = grpc.NewServer()
for _, service := range c.services {
service.Register(c.server)
}
c.Unlock()
listener := &OutboundListener{
buffer: make(chan net.Conn, 4),
done: done.New(),
}
go func() {
if err := c.server.Serve(listener); err != nil {
newError("failed to start grpc server").Base(err).AtError().WriteToLog()
}
}()
if err := c.ohm.RemoveHandler(context.Background(), c.tag); err != nil {
newError("failed to remove existing handler").WriteToLog()
}
return c.ohm.AddHandler(context.Background(), &Outbound{
tag: c.tag,
listener: listener,
})
}
// Close implements common.Closable.
func (c *Commander) Close() error {
c.Lock()
defer c.Unlock()
if c.server != nil {
c.server.Stop()
c.server = nil
}
return nil
}
// ExtractGrpcServer extracts the gRPC server from Commander.
// Private function for core code base.
func (c *Commander) ExtractGrpcServer() *grpc.Server {
c.Lock()
defer c.Unlock()
return c.server
}
func init() {
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, cfg interface{}) (interface{}, error) {
return NewCommander(ctx, cfg.(*Config))
}))
}
func init() {
common.Must(common.RegisterConfig((*SimplifiedConfig)(nil), func(ctx context.Context, cfg interface{}) (interface{}, error) {
simplifiedConfig := cfg.(*SimplifiedConfig)
fullConfig := &Config{
Tag: simplifiedConfig.Tag,
Service: nil,
}
for _, v := range simplifiedConfig.Name {
pack, err := v5cfg.LoadHeterogeneousConfigFromRawJSON(ctx, "grpcservice", v, []byte("{}"))
if err != nil {
return nil, err
}
fullConfig.Service = append(fullConfig.Service, serial.ToTypedMessage(pack))
}
return common.CreateObject(ctx, fullConfig)
}))
}
================================================
FILE: app/commander/config.pb.go
================================================
package commander
import (
_ "github.com/v2fly/v2ray-core/v5/common/protoext"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
anypb "google.golang.org/protobuf/types/known/anypb"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Config is the settings for Commander.
type Config struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Tag of the outbound handler that handles grpc connections.
Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
// Services that supported by this server. All services must implement Service
// interface.
Service []*anypb.Any `protobuf:"bytes,2,rep,name=service,proto3" json:"service,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Config) Reset() {
*x = Config{}
mi := &file_app_commander_config_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Config) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Config) ProtoMessage() {}
func (x *Config) ProtoReflect() protoreflect.Message {
mi := &file_app_commander_config_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Config.ProtoReflect.Descriptor instead.
func (*Config) Descriptor() ([]byte, []int) {
return file_app_commander_config_proto_rawDescGZIP(), []int{0}
}
func (x *Config) GetTag() string {
if x != nil {
return x.Tag
}
return ""
}
func (x *Config) GetService() []*anypb.Any {
if x != nil {
return x.Service
}
return nil
}
// ReflectionConfig is the placeholder config for ReflectionService.
type ReflectionConfig struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ReflectionConfig) Reset() {
*x = ReflectionConfig{}
mi := &file_app_commander_config_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ReflectionConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ReflectionConfig) ProtoMessage() {}
func (x *ReflectionConfig) ProtoReflect() protoreflect.Message {
mi := &file_app_commander_config_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ReflectionConfig.ProtoReflect.Descriptor instead.
func (*ReflectionConfig) Descriptor() ([]byte, []int) {
return file_app_commander_config_proto_rawDescGZIP(), []int{1}
}
type SimplifiedConfig struct {
state protoimpl.MessageState `protogen:"open.v1"`
Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
Name []string `protobuf:"bytes,2,rep,name=name,proto3" json:"name,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SimplifiedConfig) Reset() {
*x = SimplifiedConfig{}
mi := &file_app_commander_config_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SimplifiedConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SimplifiedConfig) ProtoMessage() {}
func (x *SimplifiedConfig) ProtoReflect() protoreflect.Message {
mi := &file_app_commander_config_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SimplifiedConfig.ProtoReflect.Descriptor instead.
func (*SimplifiedConfig) Descriptor() ([]byte, []int) {
return file_app_commander_config_proto_rawDescGZIP(), []int{2}
}
func (x *SimplifiedConfig) GetTag() string {
if x != nil {
return x.Tag
}
return ""
}
func (x *SimplifiedConfig) GetName() []string {
if x != nil {
return x.Name
}
return nil
}
var File_app_commander_config_proto protoreflect.FileDescriptor
const file_app_commander_config_proto_rawDesc = "" +
"\n" +
"\x1aapp/commander/config.proto\x12\x18v2ray.core.app.commander\x1a\x19google/protobuf/any.proto\x1a common/protoext/extensions.proto\"J\n" +
"\x06Config\x12\x10\n" +
"\x03tag\x18\x01 \x01(\tR\x03tag\x12.\n" +
"\aservice\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\aservice\"1\n" +
"\x10ReflectionConfig:\x1d\x82\xb5\x18\x19\n" +
"\vgrpcservice\x12\n" +
"reflection\"R\n" +
"\x10SimplifiedConfig\x12\x10\n" +
"\x03tag\x18\x01 \x01(\tR\x03tag\x12\x12\n" +
"\x04name\x18\x02 \x03(\tR\x04name:\x18\x82\xb5\x18\x14\n" +
"\aservice\x12\tcommanderBi\n" +
"\x1ccom.v2ray.core.app.commanderP\x01Z,github.com/v2fly/v2ray-core/v5/app/commander\xaa\x02\x18V2Ray.Core.App.Commanderb\x06proto3"
var (
file_app_commander_config_proto_rawDescOnce sync.Once
file_app_commander_config_proto_rawDescData []byte
)
func file_app_commander_config_proto_rawDescGZIP() []byte {
file_app_commander_config_proto_rawDescOnce.Do(func() {
file_app_commander_config_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_app_commander_config_proto_rawDesc), len(file_app_commander_config_proto_rawDesc)))
})
return file_app_commander_config_proto_rawDescData
}
var file_app_commander_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_app_commander_config_proto_goTypes = []any{
(*Config)(nil), // 0: v2ray.core.app.commander.Config
(*ReflectionConfig)(nil), // 1: v2ray.core.app.commander.ReflectionConfig
(*SimplifiedConfig)(nil), // 2: v2ray.core.app.commander.SimplifiedConfig
(*anypb.Any)(nil), // 3: google.protobuf.Any
}
var file_app_commander_config_proto_depIdxs = []int32{
3, // 0: v2ray.core.app.commander.Config.service:type_name -> google.protobuf.Any
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_app_commander_config_proto_init() }
func file_app_commander_config_proto_init() {
if File_app_commander_config_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_app_commander_config_proto_rawDesc), len(file_app_commander_config_proto_rawDesc)),
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_app_commander_config_proto_goTypes,
DependencyIndexes: file_app_commander_config_proto_depIdxs,
MessageInfos: file_app_commander_config_proto_msgTypes,
}.Build()
File_app_commander_config_proto = out.File
file_app_commander_config_proto_goTypes = nil
file_app_commander_config_proto_depIdxs = nil
}
================================================
FILE: app/commander/config.proto
================================================
syntax = "proto3";
package v2ray.core.app.commander;
option csharp_namespace = "V2Ray.Core.App.Commander";
option go_package = "github.com/v2fly/v2ray-core/v5/app/commander";
option java_package = "com.v2ray.core.app.commander";
option java_multiple_files = true;
import "google/protobuf/any.proto";
import "common/protoext/extensions.proto";
// Config is the settings for Commander.
message Config {
// Tag of the outbound handler that handles grpc connections.
string tag = 1;
// Services that supported by this server. All services must implement Service
// interface.
repeated google.protobuf.Any service = 2;
}
// ReflectionConfig is the placeholder config for ReflectionService.
message ReflectionConfig {
option (v2ray.core.common.protoext.message_opt).type = "grpcservice";
option (v2ray.core.common.protoext.message_opt).short_name = "reflection";
}
message SimplifiedConfig {
option (v2ray.core.common.protoext.message_opt).type = "service";
option (v2ray.core.common.protoext.message_opt).short_name = "commander";
string tag = 1;
repeated string name = 2;
}
================================================
FILE: app/commander/errors.generated.go
================================================
package commander
import "github.com/v2fly/v2ray-core/v5/common/errors"
type errPathObjHolder struct{}
func newError(values ...interface{}) *errors.Error {
return errors.New(values...).WithPathObj(errPathObjHolder{})
}
================================================
FILE: app/commander/outbound.go
================================================
package commander
import (
"context"
"sync"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/net"
"github.com/v2fly/v2ray-core/v5/common/signal/done"
"github.com/v2fly/v2ray-core/v5/transport"
)
func NewOutboundListener() *OutboundListener {
return &OutboundListener{
buffer: make(chan net.Conn, 4),
done: done.New(),
}
}
// OutboundListener is a net.Listener for listening gRPC connections.
type OutboundListener struct {
buffer chan net.Conn
done *done.Instance
}
func (l *OutboundListener) add(conn net.Conn) {
select {
case l.buffer <- conn:
case <-l.done.Wait():
conn.Close()
default:
conn.Close()
}
}
// Accept implements net.Listener.
func (l *OutboundListener) Accept() (net.Conn, error) {
select {
case <-l.done.Wait():
return nil, newError("listen closed")
case c := <-l.buffer:
return c, nil
}
}
// Close implement net.Listener.
func (l *OutboundListener) Close() error {
common.Must(l.done.Close())
L:
for {
select {
case c := <-l.buffer:
c.Close()
default:
break L
}
}
return nil
}
// Addr implements net.Listener.
func (l *OutboundListener) Addr() net.Addr {
return &net.TCPAddr{
IP: net.IP{0, 0, 0, 0},
Port: 0,
}
}
func NewOutbound(tag string, listener *OutboundListener) *Outbound {
return &Outbound{
tag: tag,
listener: listener,
}
}
// Outbound is a outbound.Handler that handles gRPC connections.
type Outbound struct {
tag string
listener *OutboundListener
access sync.RWMutex
closed bool
}
// Dispatch implements outbound.Handler.
func (co *Outbound) Dispatch(ctx context.Context, link *transport.Link) {
co.access.RLock()
if co.closed {
common.Interrupt(link.Reader)
common.Interrupt(link.Writer)
co.access.RUnlock()
return
}
closeSignal := done.New()
c := net.NewConnection(net.ConnectionInputMulti(link.Writer), net.ConnectionOutputMulti(link.Reader), net.ConnectionOnClose(closeSignal))
co.listener.add(c)
co.access.RUnlock()
<-closeSignal.Wait()
}
// Tag implements outbound.Handler.
func (co *Outbound) Tag() string {
return co.tag
}
// Start implements common.Runnable.
func (co *Outbound) Start() error {
co.access.Lock()
co.closed = false
co.access.Unlock()
return nil
}
// Close implements common.Closable.
func (co *Outbound) Close() error {
co.access.Lock()
defer co.access.Unlock()
co.closed = true
return co.listener.Close()
}
================================================
FILE: app/commander/service.go
================================================
package commander
import (
"context"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
"github.com/v2fly/v2ray-core/v5/common"
)
// Service is a Commander service.
type Service interface {
// Register registers the service itself to a gRPC server.
Register(*grpc.Server)
}
type reflectionService struct{}
func (r reflectionService) Register(s *grpc.Server) {
reflection.Register(s)
}
func init() {
common.Must(common.RegisterConfig((*ReflectionConfig)(nil), func(ctx context.Context, cfg interface{}) (interface{}, error) {
return reflectionService{}, nil
}))
}
================================================
FILE: app/commander/webcommander/config.pb.go
================================================
package webcommander
import (
_ "github.com/v2fly/v2ray-core/v5/common/protoext"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Config struct {
state protoimpl.MessageState `protogen:"open.v1"`
Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
WebRoot []byte `protobuf:"bytes,2,opt,name=web_root,json=webRoot,proto3" json:"web_root,omitempty"`
WebRootFile string `protobuf:"bytes,96002,opt,name=web_root_file,json=webRootFile,proto3" json:"web_root_file,omitempty"`
ApiMountpoint string `protobuf:"bytes,3,opt,name=api_mountpoint,json=apiMountpoint,proto3" json:"api_mountpoint,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Config) Reset() {
*x = Config{}
mi := &file_app_commander_webcommander_config_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Config) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Config) ProtoMessage() {}
func (x *Config) ProtoReflect() protoreflect.Message {
mi := &file_app_commander_webcommander_config_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Config.ProtoReflect.Descriptor instead.
func (*Config) Descriptor() ([]byte, []int) {
return file_app_commander_webcommander_config_proto_rawDescGZIP(), []int{0}
}
func (x *Config) GetTag() string {
if x != nil {
return x.Tag
}
return ""
}
func (x *Config) GetWebRoot() []byte {
if x != nil {
return x.WebRoot
}
return nil
}
func (x *Config) GetWebRootFile() string {
if x != nil {
return x.WebRootFile
}
return ""
}
func (x *Config) GetApiMountpoint() string {
if x != nil {
return x.ApiMountpoint
}
return ""
}
var File_app_commander_webcommander_config_proto protoreflect.FileDescriptor
const file_app_commander_webcommander_config_proto_rawDesc = "" +
"\n" +
"'app/commander/webcommander/config.proto\x12%v2ray.core.app.commander.webcommander\x1a common/protoext/extensions.proto\"\xaf\x01\n" +
"\x06Config\x12\x10\n" +
"\x03tag\x18\x01 \x01(\tR\x03tag\x12\x19\n" +
"\bweb_root\x18\x02 \x01(\fR\awebRoot\x124\n" +
"\rweb_root_file\x18\x82\xee\x05 \x01(\tB\x0e\x82\xb5\x18\n" +
"\"\bweb_rootR\vwebRootFile\x12%\n" +
"\x0eapi_mountpoint\x18\x03 \x01(\tR\rapiMountpoint:\x1b\x82\xb5\x18\x17\n" +
"\aservice\x12\fwebcommanderB\x90\x01\n" +
")com.v2ray.core.app.commander.webcommanderP\x01Z9github.com/v2fly/v2ray-core/v5/app/commander/webcommander\xaa\x02%V2Ray.Core.App.Commander.WebCommanderb\x06proto3"
var (
file_app_commander_webcommander_config_proto_rawDescOnce sync.Once
file_app_commander_webcommander_config_proto_rawDescData []byte
)
func file_app_commander_webcommander_config_proto_rawDescGZIP() []byte {
file_app_commander_webcommander_config_proto_rawDescOnce.Do(func() {
file_app_commander_webcommander_config_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_app_commander_webcommander_config_proto_rawDesc), len(file_app_commander_webcommander_config_proto_rawDesc)))
})
return file_app_commander_webcommander_config_proto_rawDescData
}
var file_app_commander_webcommander_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_app_commander_webcommander_config_proto_goTypes = []any{
(*Config)(nil), // 0: v2ray.core.app.commander.webcommander.Config
}
var file_app_commander_webcommander_config_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_app_commander_webcommander_config_proto_init() }
func file_app_commander_webcommander_config_proto_init() {
if File_app_commander_webcommander_config_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_app_commander_webcommander_config_proto_rawDesc), len(file_app_commander_webcommander_config_proto_rawDesc)),
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_app_commander_webcommander_config_proto_goTypes,
DependencyIndexes: file_app_commander_webcommander_config_proto_depIdxs,
MessageInfos: file_app_commander_webcommander_config_proto_msgTypes,
}.Build()
File_app_commander_webcommander_config_proto = out.File
file_app_commander_webcommander_config_proto_goTypes = nil
file_app_commander_webcommander_config_proto_depIdxs = nil
}
================================================
FILE: app/commander/webcommander/config.proto
================================================
syntax = "proto3";
package v2ray.core.app.commander.webcommander;
option csharp_namespace = "V2Ray.Core.App.Commander.WebCommander";
option go_package = "github.com/v2fly/v2ray-core/v5/app/commander/webcommander";
option java_package = "com.v2ray.core.app.commander.webcommander";
option java_multiple_files = true;
import "common/protoext/extensions.proto";
message Config {
option (v2ray.core.common.protoext.message_opt).type = "service";
option (v2ray.core.common.protoext.message_opt).short_name = "webcommander";
string tag = 1;
bytes web_root = 2;
string web_root_file = 96002 [(v2ray.core.common.protoext.field_opt).convert_time_read_file_into = "web_root"];
string api_mountpoint = 3;
}
================================================
FILE: app/commander/webcommander/errors.generated.go
================================================
package webcommander
import "github.com/v2fly/v2ray-core/v5/common/errors"
type errPathObjHolder struct{}
func newError(values ...interface{}) *errors.Error {
return errors.New(values...).WithPathObj(errPathObjHolder{})
}
================================================
FILE: app/commander/webcommander/webcommander.go
================================================
package webcommander
import (
"archive/zip"
"bytes"
"context"
"io/fs"
"net/http"
"strings"
"sync"
"time"
"github.com/improbable-eng/grpc-web/go/grpcweb"
"google.golang.org/grpc"
core "github.com/v2fly/v2ray-core/v5"
"github.com/v2fly/v2ray-core/v5/app/commander"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/features/outbound"
)
//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen
func newWebCommander(ctx context.Context, config *Config) (*WebCommander, error) {
if config == nil {
return nil, newError("config is nil")
}
if config.Tag == "" {
return nil, newError("config.Tag is empty")
}
var webRootfs fs.FS
if config.WebRoot != nil {
zipReader, err := zip.NewReader(bytes.NewReader(config.WebRoot), int64(len(config.WebRoot)))
if err != nil {
return nil, newError("failed to create zip reader").Base(err)
}
webRootfs = zipReader
}
return &WebCommander{ctx: ctx, config: config, webRootfs: webRootfs}, nil
}
type WebCommander struct {
sync.Mutex
ctx context.Context
ohm outbound.Manager
cm commander.CommanderIfce
server *http.Server
wrappedGrpc *grpcweb.WrappedGrpcServer
webRootfs fs.FS
config *Config
}
func (w *WebCommander) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
apiPath := w.config.ApiMountpoint
if strings.HasPrefix(request.URL.Path, apiPath) {
request.URL.Path = strings.TrimPrefix(request.URL.Path, apiPath)
if w.wrappedGrpc.IsGrpcWebRequest(request) {
w.wrappedGrpc.ServeHTTP(writer, request)
return
}
}
if w.webRootfs != nil {
http.ServeFileFS(writer, request, w.webRootfs, request.URL.Path)
return
}
writer.WriteHeader(http.StatusNotFound)
}
func (w *WebCommander) asyncStart() {
var grpcServer *grpc.Server
for {
grpcServer = w.cm.ExtractGrpcServer()
if grpcServer != nil {
break
}
time.Sleep(time.Second)
}
listener := commander.NewOutboundListener()
wrappedGrpc := grpcweb.WrapServer(grpcServer)
w.server = &http.Server{}
w.wrappedGrpc = wrappedGrpc
w.server.Handler = w
go func() {
err := w.server.Serve(listener)
if err != nil {
newError("failed to serve HTTP").Base(err).WriteToLog()
}
}()
if err := w.ohm.RemoveHandler(context.Background(), w.config.Tag); err != nil {
newError("failed to remove existing handler").WriteToLog()
}
if err := w.ohm.AddHandler(context.Background(), commander.NewOutbound(w.config.Tag, listener)); err != nil {
newError("failed to add handler").Base(err).WriteToLog()
}
}
func (w *WebCommander) Type() interface{} {
return (*WebCommander)(nil)
}
func (w *WebCommander) Start() error {
if err := core.RequireFeatures(w.ctx, func(cm commander.CommanderIfce, om outbound.Manager) {
w.Lock()
defer w.Unlock()
w.cm = cm
w.ohm = om
go w.asyncStart()
}); err != nil {
return err
}
return nil
}
func (w *WebCommander) Close() error {
w.Lock()
defer w.Unlock()
if w.server != nil {
if err := w.server.Close(); err != nil {
return newError("failed to close http server").Base(err)
}
w.server = nil
}
return nil
}
func init() {
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
return newWebCommander(ctx, config.(*Config))
}))
}
================================================
FILE: app/dispatcher/config.pb.go
================================================
package dispatcher
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type SessionConfig struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SessionConfig) Reset() {
*x = SessionConfig{}
mi := &file_app_dispatcher_config_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SessionConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SessionConfig) ProtoMessage() {}
func (x *SessionConfig) ProtoReflect() protoreflect.Message {
mi := &file_app_dispatcher_config_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SessionConfig.ProtoReflect.Descriptor instead.
func (*SessionConfig) Descriptor() ([]byte, []int) {
return file_app_dispatcher_config_proto_rawDescGZIP(), []int{0}
}
type Config struct {
state protoimpl.MessageState `protogen:"open.v1"`
Settings *SessionConfig `protobuf:"bytes,1,opt,name=settings,proto3" json:"settings,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Config) Reset() {
*x = Config{}
mi := &file_app_dispatcher_config_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Config) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Config) ProtoMessage() {}
func (x *Config) ProtoReflect() protoreflect.Message {
mi := &file_app_dispatcher_config_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Config.ProtoReflect.Descriptor instead.
func (*Config) Descriptor() ([]byte, []int) {
return file_app_dispatcher_config_proto_rawDescGZIP(), []int{1}
}
func (x *Config) GetSettings() *SessionConfig {
if x != nil {
return x.Settings
}
return nil
}
var File_app_dispatcher_config_proto protoreflect.FileDescriptor
const file_app_dispatcher_config_proto_rawDesc = "" +
"\n" +
"\x1bapp/dispatcher/config.proto\x12\x19v2ray.core.app.dispatcher\"\x15\n" +
"\rSessionConfigJ\x04\b\x01\x10\x02\"N\n" +
"\x06Config\x12D\n" +
"\bsettings\x18\x01 \x01(\v2(.v2ray.core.app.dispatcher.SessionConfigR\bsettingsBl\n" +
"\x1dcom.v2ray.core.app.dispatcherP\x01Z-github.com/v2fly/v2ray-core/v5/app/dispatcher\xaa\x02\x19V2Ray.Core.App.Dispatcherb\x06proto3"
var (
file_app_dispatcher_config_proto_rawDescOnce sync.Once
file_app_dispatcher_config_proto_rawDescData []byte
)
func file_app_dispatcher_config_proto_rawDescGZIP() []byte {
file_app_dispatcher_config_proto_rawDescOnce.Do(func() {
file_app_dispatcher_config_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_app_dispatcher_config_proto_rawDesc), len(file_app_dispatcher_config_proto_rawDesc)))
})
return file_app_dispatcher_config_proto_rawDescData
}
var file_app_dispatcher_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_app_dispatcher_config_proto_goTypes = []any{
(*SessionConfig)(nil), // 0: v2ray.core.app.dispatcher.SessionConfig
(*Config)(nil), // 1: v2ray.core.app.dispatcher.Config
}
var file_app_dispatcher_config_proto_depIdxs = []int32{
0, // 0: v2ray.core.app.dispatcher.Config.settings:type_name -> v2ray.core.app.dispatcher.SessionConfig
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_app_dispatcher_config_proto_init() }
func file_app_dispatcher_config_proto_init() {
if File_app_dispatcher_config_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_app_dispatcher_config_proto_rawDesc), len(file_app_dispatcher_config_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_app_dispatcher_config_proto_goTypes,
DependencyIndexes: file_app_dispatcher_config_proto_depIdxs,
MessageInfos: file_app_dispatcher_config_proto_msgTypes,
}.Build()
File_app_dispatcher_config_proto = out.File
file_app_dispatcher_config_proto_goTypes = nil
file_app_dispatcher_config_proto_depIdxs = nil
}
================================================
FILE: app/dispatcher/config.proto
================================================
syntax = "proto3";
package v2ray.core.app.dispatcher;
option csharp_namespace = "V2Ray.Core.App.Dispatcher";
option go_package = "github.com/v2fly/v2ray-core/v5/app/dispatcher";
option java_package = "com.v2ray.core.app.dispatcher";
option java_multiple_files = true;
message SessionConfig {
reserved 1;
}
message Config {
SessionConfig settings = 1;
}
================================================
FILE: app/dispatcher/default.go
================================================
package dispatcher
//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen
import (
"context"
"strings"
"sync"
"time"
core "github.com/v2fly/v2ray-core/v5"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/buf"
"github.com/v2fly/v2ray-core/v5/common/log"
"github.com/v2fly/v2ray-core/v5/common/net"
"github.com/v2fly/v2ray-core/v5/common/protocol"
"github.com/v2fly/v2ray-core/v5/common/session"
"github.com/v2fly/v2ray-core/v5/common/strmatcher"
"github.com/v2fly/v2ray-core/v5/features/outbound"
"github.com/v2fly/v2ray-core/v5/features/policy"
"github.com/v2fly/v2ray-core/v5/features/routing"
routing_session "github.com/v2fly/v2ray-core/v5/features/routing/session"
"github.com/v2fly/v2ray-core/v5/features/stats"
"github.com/v2fly/v2ray-core/v5/transport"
"github.com/v2fly/v2ray-core/v5/transport/pipe"
)
var errSniffingTimeout = newError("timeout on sniffing")
type cachedReader struct {
sync.Mutex
reader *pipe.Reader
cache buf.MultiBuffer
}
func (r *cachedReader) Cache(b *buf.Buffer, deadline time.Duration) error {
mb, err := r.reader.ReadMultiBufferTimeout(deadline)
if err != nil {
return err
}
r.Lock()
if !mb.IsEmpty() {
r.cache, _ = buf.MergeMulti(r.cache, mb)
}
b.Clear()
rawBytes := b.Extend(b.Cap())
n := r.cache.Copy(rawBytes)
b.Resize(0, int32(n))
r.Unlock()
return nil
}
func (r *cachedReader) readInternal() buf.MultiBuffer {
r.Lock()
defer r.Unlock()
if r.cache != nil && !r.cache.IsEmpty() {
mb := r.cache
r.cache = nil
return mb
}
return nil
}
func (r *cachedReader) ReadMultiBuffer() (buf.MultiBuffer, error) {
mb := r.readInternal()
if mb != nil {
return mb, nil
}
return r.reader.ReadMultiBuffer()
}
func (r *cachedReader) ReadMultiBufferTimeout(timeout time.Duration) (buf.MultiBuffer, error) {
mb := r.readInternal()
if mb != nil {
return mb, nil
}
return r.reader.ReadMultiBufferTimeout(timeout)
}
func (r *cachedReader) Interrupt() {
r.Lock()
if r.cache != nil {
r.cache = buf.ReleaseMulti(r.cache)
}
r.Unlock()
r.reader.Interrupt()
}
// DefaultDispatcher is a default implementation of Dispatcher.
type DefaultDispatcher struct {
ohm outbound.Manager
router routing.Router
policy policy.Manager
stats stats.Manager
}
func init() {
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
d := new(DefaultDispatcher)
if err := core.RequireFeatures(ctx, func(om outbound.Manager, router routing.Router, pm policy.Manager, sm stats.Manager) error {
return d.Init(config.(*Config), om, router, pm, sm)
}); err != nil {
return nil, err
}
return d, nil
}))
}
// Init initializes DefaultDispatcher.
func (d *DefaultDispatcher) Init(config *Config, om outbound.Manager, router routing.Router, pm policy.Manager, sm stats.Manager) error {
d.ohm = om
d.router = router
d.policy = pm
d.stats = sm
return nil
}
// Type implements common.HasType.
func (*DefaultDispatcher) Type() interface{} {
return routing.DispatcherType()
}
// Start implements common.Runnable.
func (*DefaultDispatcher) Start() error {
return nil
}
// Close implements common.Closable.
func (*DefaultDispatcher) Close() error { return nil }
func (d *DefaultDispatcher) getLink(ctx context.Context) (*transport.Link, *transport.Link) {
opt := pipe.OptionsFromContext(ctx)
uplinkReader, uplinkWriter := pipe.New(opt...)
downlinkReader, downlinkWriter := pipe.New(opt...)
inboundLink := &transport.Link{
Reader: downlinkReader,
Writer: uplinkWriter,
}
outboundLink := &transport.Link{
Reader: uplinkReader,
Writer: downlinkWriter,
}
sessionInbound := session.InboundFromContext(ctx)
var user *protocol.MemoryUser
if sessionInbound != nil {
user = sessionInbound.User
}
if user != nil && len(user.Email) > 0 {
p := d.policy.ForLevel(user.Level)
if p.Stats.UserUplink {
name := "user>>>" + user.Email + ">>>traffic>>>uplink"
if c, _ := stats.GetOrRegisterCounter(d.stats, name); c != nil {
inboundLink.Writer = &SizeStatWriter{
Counter: c,
Writer: inboundLink.Writer,
}
}
}
if p.Stats.UserDownlink {
name := "user>>>" + user.Email + ">>>traffic>>>downlink"
if c, _ := stats.GetOrRegisterCounter(d.stats, name); c != nil {
outboundLink.Writer = &SizeStatWriter{
Counter: c,
Writer: outboundLink.Writer,
}
}
}
}
return inboundLink, outboundLink
}
func shouldOverride(result SniffResult, domainOverride []string) bool {
if result.Domain() == "" {
return false
}
protocolString := result.Protocol()
if resComp, ok := result.(SnifferResultComposite); ok {
protocolString = resComp.ProtocolForDomainResult()
}
for _, p := range domainOverride {
if strings.HasPrefix(protocolString, p) || strings.HasSuffix(protocolString, p) {
return true
}
if resultSubset, ok := result.(SnifferIsProtoSubsetOf); ok {
if resultSubset.IsProtoSubsetOf(p) {
return true
}
}
}
return false
}
// Dispatch implements routing.Dispatcher.
func (d *DefaultDispatcher) Dispatch(ctx context.Context, destination net.Destination) (*transport.Link, error) {
if !destination.IsValid() {
panic("Dispatcher: Invalid destination.")
}
ob := &session.Outbound{
Target: destination,
}
ctx = session.ContextWithOutbound(ctx, ob)
inbound, outbound := d.getLink(ctx)
content := session.ContentFromContext(ctx)
if content == nil {
content = new(session.Content)
ctx = session.ContextWithContent(ctx, content)
}
sniffingRequest := content.SniffingRequest
if !sniffingRequest.Enabled {
go d.routedDispatch(ctx, outbound, destination)
} else {
go func() {
cReader := &cachedReader{
reader: outbound.Reader.(*pipe.Reader),
}
outbound.Reader = cReader
result, err := sniffer(ctx, cReader, sniffingRequest.MetadataOnly, destination.Network)
if err == nil {
content.Protocol = result.Protocol()
}
if err == nil && shouldOverride(result, sniffingRequest.OverrideDestinationForProtocol) {
if domain, err := strmatcher.ToDomain(result.Domain()); err == nil {
newError("sniffed domain: ", domain, " for ", destination).WriteToLog(session.ExportIDToError(ctx))
destination.Address = net.ParseAddress(domain)
ob.Target = destination
}
}
d.routedDispatch(ctx, outbound, destination)
}()
}
return inbound, nil
}
func sniffer(ctx context.Context, cReader *cachedReader, metadataOnly bool, network net.Network) (SniffResult, error) {
payload := buf.NewWithSize(32767)
defer payload.Release()
sniffer := NewSniffer(ctx)
metaresult, metadataErr := sniffer.SniffMetadata(ctx)
if metadataOnly {
return metaresult, metadataErr
}
contentResult, contentErr := func() (SniffResult, error) {
cacheDeadline := 200 * time.Millisecond
totalAttempt := 0
for {
select {
case <-ctx.Done():
return nil, ctx.Err()
default:
cachingStartingTimeStamp := time.Now()
cacheErr := cReader.Cache(payload, cacheDeadline)
cachingTimeElapsed := time.Since(cachingStartingTimeStamp)
cacheDeadline -= cachingTimeElapsed
if !payload.IsEmpty() {
result, err := sniffer.Sniff(ctx, payload.Bytes(), network)
switch err {
case common.ErrNoClue: // No Clue: protocol not matches, and sniffer cannot determine whether there will be a match or not
totalAttempt++
case protocol.ErrProtoNeedMoreData: // Protocol Need More Data: protocol matches, but need more data to complete sniffing
if cacheErr != nil { // Cache error (e.g. timeout) counts for failed attempt
totalAttempt++
}
default:
return result, err
}
}
if totalAttempt >= 2 || cacheDeadline <= 0 {
return nil, errSniffingTimeout
}
}
}
}()
if contentErr != nil && metadataErr == nil {
return metaresult, nil
}
if contentErr == nil && metadataErr == nil {
return CompositeResult(metaresult, contentResult), nil
}
return contentResult, contentErr
}
func (d *DefaultDispatcher) routedDispatch(ctx context.Context, link *transport.Link, destination net.Destination) {
var handler outbound.Handler
if forcedOutboundTag := session.GetForcedOutboundTagFromContext(ctx); forcedOutboundTag != "" {
ctx = session.SetForcedOutboundTagToContext(ctx, "")
if h := d.ohm.GetHandler(forcedOutboundTag); h != nil {
newError("taking platform initialized detour [", forcedOutboundTag, "] for [", destination, "]").WriteToLog(session.ExportIDToError(ctx))
handler = h
} else {
newError("non existing tag for platform initialized detour: ", forcedOutboundTag).AtError().WriteToLog(session.ExportIDToError(ctx))
common.Close(link.Writer)
common.Interrupt(link.Reader)
return
}
} else if d.router != nil {
if route, err := d.router.PickRoute(routing_session.AsRoutingContext(ctx)); err == nil {
tag := route.GetOutboundTag()
if h := d.ohm.GetHandler(tag); h != nil {
newError("taking detour [", tag, "] for [", destination, "]").WriteToLog(session.ExportIDToError(ctx))
handler = h
} else {
newError("non existing tag: ", tag).AtWarning().WriteToLog(session.ExportIDToError(ctx))
}
} else {
newError("default route for ", destination).AtWarning().WriteToLog(session.ExportIDToError(ctx))
}
}
if handler == nil {
handler = d.ohm.GetDefaultHandler()
}
if handler == nil {
newError("default outbound handler not exist").WriteToLog(session.ExportIDToError(ctx))
common.Close(link.Writer)
common.Interrupt(link.Reader)
return
}
if accessMessage := log.AccessMessageFromContext(ctx); accessMessage != nil {
if tag := handler.Tag(); tag != "" {
accessMessage.Detour = tag
if d.policy.ForSystem().OverrideAccessLogDest {
accessMessage.To = destination
}
}
log.Record(accessMessage)
}
handler.Dispatch(ctx, link)
}
================================================
FILE: app/dispatcher/dispatcher.go
================================================
package dispatcher
//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen
================================================
FILE: app/dispatcher/errors.generated.go
================================================
package dispatcher
import "github.com/v2fly/v2ray-core/v5/common/errors"
type errPathObjHolder struct{}
func newError(values ...interface{}) *errors.Error {
return errors.New(values...).WithPathObj(errPathObjHolder{})
}
================================================
FILE: app/dispatcher/fakednssniffer.go
================================================
//go:build !confonly
// +build !confonly
package dispatcher
import (
"context"
"strings"
core "github.com/v2fly/v2ray-core/v5"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/net"
"github.com/v2fly/v2ray-core/v5/common/session"
"github.com/v2fly/v2ray-core/v5/features/dns"
)
// newFakeDNSSniffer Creates a Fake DNS metadata sniffer
func newFakeDNSSniffer(ctx context.Context) (protocolSnifferWithMetadata, error) {
var fakeDNSEngine dns.FakeDNSEngine
{
fakeDNSEngineFeat := core.MustFromContext(ctx).GetFeature((*dns.FakeDNSEngine)(nil))
if fakeDNSEngineFeat != nil {
fakeDNSEngine = fakeDNSEngineFeat.(dns.FakeDNSEngine)
}
}
if fakeDNSEngine == nil {
errNotInit := newError("FakeDNSEngine is not initialized, but such a sniffer is used").AtError()
return protocolSnifferWithMetadata{}, errNotInit
}
return protocolSnifferWithMetadata{protocolSniffer: func(ctx context.Context, bytes []byte) (SniffResult, error) {
Target := session.OutboundFromContext(ctx).Target
if Target.Network == net.Network_TCP || Target.Network == net.Network_UDP {
domainFromFakeDNS := fakeDNSEngine.GetDomainFromFakeDNS(Target.Address)
if domainFromFakeDNS != "" {
newError("fake dns got domain: ", domainFromFakeDNS, " for ip: ", Target.Address.String()).WriteToLog(session.ExportIDToError(ctx))
return &fakeDNSSniffResult{domainName: domainFromFakeDNS}, nil
}
}
if ipAddressInRangeValueI := ctx.Value(ipAddressInRange); ipAddressInRangeValueI != nil {
ipAddressInRangeValue := ipAddressInRangeValueI.(*ipAddressInRangeOpt)
if fkr0, ok := fakeDNSEngine.(dns.FakeDNSEngineRev0); ok {
inPool := fkr0.IsIPInIPPool(Target.Address)
ipAddressInRangeValue.addressInRange = &inPool
}
}
return nil, common.ErrNoClue
}, metadataSniffer: true}, nil
}
type fakeDNSSniffResult struct {
domainName string
}
func (fakeDNSSniffResult) Protocol() string {
return "fakedns"
}
func (f fakeDNSSniffResult) Domain() string {
return f.domainName
}
type fakeDNSExtraOpts int
const ipAddressInRange fakeDNSExtraOpts = 1
type ipAddressInRangeOpt struct {
addressInRange *bool
}
type DNSThenOthersSniffResult struct {
domainName string
protocolOriginalName string
}
func (f DNSThenOthersSniffResult) IsProtoSubsetOf(protocolName string) bool {
return strings.HasPrefix(protocolName, f.protocolOriginalName)
}
func (DNSThenOthersSniffResult) Protocol() string {
return "fakedns+others"
}
func (f DNSThenOthersSniffResult) Domain() string {
return f.domainName
}
func newFakeDNSThenOthers(ctx context.Context, fakeDNSSniffer protocolSnifferWithMetadata, others []protocolSnifferWithMetadata) (protocolSnifferWithMetadata, error) { // nolint: unparam
// ctx may be used in the future
_ = ctx
return protocolSnifferWithMetadata{
protocolSniffer: func(ctx context.Context, bytes []byte) (SniffResult, error) {
ipAddressInRangeValue := &ipAddressInRangeOpt{}
ctx = context.WithValue(ctx, ipAddressInRange, ipAddressInRangeValue)
result, err := fakeDNSSniffer.protocolSniffer(ctx, bytes)
if err == nil {
return result, nil
}
if ipAddressInRangeValue.addressInRange != nil {
if *ipAddressInRangeValue.addressInRange {
for _, v := range others {
if v.metadataSniffer || bytes != nil {
if result, err := v.protocolSniffer(ctx, bytes); err == nil {
return DNSThenOthersSniffResult{domainName: result.Domain(), protocolOriginalName: result.Protocol()}, nil
}
}
}
return nil, common.ErrNoClue
}
newError("ip address not in fake dns range, return as is").AtDebug().WriteToLog()
return nil, common.ErrNoClue
}
newError("fake dns sniffer did not set address in range option, assume false.").AtWarning().WriteToLog()
return nil, common.ErrNoClue
},
metadataSniffer: false,
}, nil
}
================================================
FILE: app/dispatcher/sniffer.go
================================================
package dispatcher
import (
"context"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/net"
"github.com/v2fly/v2ray-core/v5/common/protocol"
"github.com/v2fly/v2ray-core/v5/common/protocol/bittorrent"
"github.com/v2fly/v2ray-core/v5/common/protocol/http"
"github.com/v2fly/v2ray-core/v5/common/protocol/quic"
"github.com/v2fly/v2ray-core/v5/common/protocol/tls"
)
type SniffResult interface {
Protocol() string
Domain() string
}
type protocolSniffer func(context.Context, []byte) (SniffResult, error)
type protocolSnifferWithMetadata struct {
protocolSniffer protocolSniffer
// A Metadata sniffer will be invoked on connection establishment only, with nil body,
// for both TCP and UDP connections
// It will not be shown as a traffic type for routing unless there is no other successful sniffing.
metadataSniffer bool
network net.Network
}
type Sniffer struct {
sniffer []protocolSnifferWithMetadata
}
func NewSniffer(ctx context.Context) *Sniffer {
ret := &Sniffer{
sniffer: []protocolSnifferWithMetadata{
{func(c context.Context, b []byte) (SniffResult, error) { return http.SniffHTTP(b) }, false, net.Network_TCP},
{func(c context.Context, b []byte) (SniffResult, error) { return tls.SniffTLS(b) }, false, net.Network_TCP},
{func(c context.Context, b []byte) (SniffResult, error) { return quic.SniffQUIC(b) }, false, net.Network_UDP},
{func(c context.Context, b []byte) (SniffResult, error) { return bittorrent.SniffBittorrent(b) }, false, net.Network_TCP},
{func(c context.Context, b []byte) (SniffResult, error) { return bittorrent.SniffUTP(b) }, false, net.Network_UDP},
},
}
if sniffer, err := newFakeDNSSniffer(ctx); err == nil {
others := ret.sniffer
ret.sniffer = append(ret.sniffer, sniffer)
fakeDNSThenOthers, err := newFakeDNSThenOthers(ctx, sniffer, others)
if err == nil {
ret.sniffer = append([]protocolSnifferWithMetadata{fakeDNSThenOthers}, ret.sniffer...)
}
}
return ret
}
var errUnknownContent = newError("unknown content")
func (s *Sniffer) Sniff(c context.Context, payload []byte, network net.Network) (SniffResult, error) {
var pendingSniffer []protocolSnifferWithMetadata
for _, si := range s.sniffer {
sniffer := si.protocolSniffer
if si.metadataSniffer {
continue
}
if si.network != network {
continue
}
result, err := sniffer(c, payload)
if err == common.ErrNoClue {
pendingSniffer = append(pendingSniffer, si)
continue
} else if err == protocol.ErrProtoNeedMoreData { // Sniffer protocol matched, but need more data to complete sniffing
s.sniffer = []protocolSnifferWithMetadata{si}
return nil, protocol.ErrProtoNeedMoreData
}
if err == nil && result != nil {
return result, nil
}
}
if len(pendingSniffer) > 0 {
s.sniffer = pendingSniffer
return nil, common.ErrNoClue
}
return nil, errUnknownContent
}
func (s *Sniffer) SniffMetadata(c context.Context) (SniffResult, error) {
var pendingSniffer []protocolSnifferWithMetadata
for _, si := range s.sniffer {
s := si.protocolSniffer
if !si.metadataSniffer {
pendingSniffer = append(pendingSniffer, si)
continue
}
result, err := s(c, nil)
if err == common.ErrNoClue {
pendingSniffer = append(pendingSniffer, si)
continue
}
if err == nil && result != nil {
return result, nil
}
}
if len(pendingSniffer) > 0 {
s.sniffer = pendingSniffer
return nil, common.ErrNoClue
}
return nil, errUnknownContent
}
func CompositeResult(domainResult SniffResult, protocolResult SniffResult) SniffResult {
return &compositeResult{domainResult: domainResult, protocolResult: protocolResult}
}
type compositeResult struct {
domainResult SniffResult
protocolResult SniffResult
}
func (c compositeResult) Protocol() string {
return c.protocolResult.Protocol()
}
func (c compositeResult) Domain() string {
return c.domainResult.Domain()
}
func (c compositeResult) ProtocolForDomainResult() string {
return c.domainResult.Protocol()
}
type SnifferResultComposite interface {
ProtocolForDomainResult() string
}
type SnifferIsProtoSubsetOf interface {
IsProtoSubsetOf(protocolName string) bool
}
================================================
FILE: app/dispatcher/stats.go
================================================
package dispatcher
import (
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/buf"
"github.com/v2fly/v2ray-core/v5/features/stats"
)
type SizeStatWriter struct {
Counter stats.Counter
Writer buf.Writer
}
func (w *SizeStatWriter) WriteMultiBuffer(mb buf.MultiBuffer) error {
w.Counter.Add(int64(mb.Len()))
return w.Writer.WriteMultiBuffer(mb)
}
func (w *SizeStatWriter) Close() error {
return common.Close(w.Writer)
}
func (w *SizeStatWriter) Interrupt() {
common.Interrupt(w.Writer)
}
================================================
FILE: app/dispatcher/stats_test.go
================================================
package dispatcher_test
import (
"testing"
. "github.com/v2fly/v2ray-core/v5/app/dispatcher"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/buf"
)
type TestCounter int64
func (c *TestCounter) Value() int64 {
return int64(*c)
}
func (c *TestCounter) Add(v int64) int64 {
x := int64(*c) + v
*c = TestCounter(x)
return x
}
func (c *TestCounter) Set(v int64) int64 {
*c = TestCounter(v)
return v
}
func TestStatsWriter(t *testing.T) {
var c TestCounter
writer := &SizeStatWriter{
Counter: &c,
Writer: buf.Discard,
}
mb := buf.MergeBytes(nil, []byte("abcd"))
common.Must(writer.WriteMultiBuffer(mb))
mb = buf.MergeBytes(nil, []byte("efg"))
common.Must(writer.WriteMultiBuffer(mb))
if c.Value() != 7 {
t.Fatal("unexpected counter value. want 7, but got ", c.Value())
}
}
================================================
FILE: app/dns/config.go
================================================
//go:build !confonly
// +build !confonly
package dns
import (
"golang.org/x/net/dns/dnsmessage"
"github.com/v2fly/v2ray-core/v5/common/net"
"github.com/v2fly/v2ray-core/v5/common/strmatcher"
"github.com/v2fly/v2ray-core/v5/common/uuid"
"github.com/v2fly/v2ray-core/v5/features/dns"
)
var typeMap = map[DomainMatchingType]strmatcher.Type{
DomainMatchingType_Full: strmatcher.Full,
DomainMatchingType_Subdomain: strmatcher.Domain,
DomainMatchingType_Keyword: strmatcher.Substr,
DomainMatchingType_Regex: strmatcher.Regex,
}
// References:
// https://www.iana.org/assignments/special-use-domain-names/special-use-domain-names.xhtml
// https://unix.stackexchange.com/questions/92441/whats-the-difference-between-local-home-and-lan
var localTLDsAndDotlessDomains = []*NameServer_PriorityDomain{
{Type: DomainMatchingType_Regex, Domain: "^[^.]+$"}, // This will only match domains without any dot
{Type: DomainMatchingType_Subdomain, Domain: "local"},
{Type: DomainMatchingType_Subdomain, Domain: "localdomain"},
{Type: DomainMatchingType_Subdomain, Domain: "localhost"},
{Type: DomainMatchingType_Subdomain, Domain: "lan"},
{Type: DomainMatchingType_Subdomain, Domain: "home.arpa"},
{Type: DomainMatchingType_Subdomain, Domain: "example"},
{Type: DomainMatchingType_Subdomain, Domain: "invalid"},
{Type: DomainMatchingType_Subdomain, Domain: "test"},
}
var localTLDsAndDotlessDomainsRule = &NameServer_OriginalRule{
Rule: "geosite:private",
Size: uint32(len(localTLDsAndDotlessDomains)),
}
func toStrMatcher(t DomainMatchingType, domain string) (strmatcher.Matcher, error) {
strMType, f := typeMap[t]
if !f {
return nil, newError("unknown mapping type", t).AtWarning()
}
matcher, err := strMType.New(domain)
if err != nil {
return nil, newError("failed to create str matcher").Base(err)
}
return matcher, nil
}
func toNetIP(addrs []net.Address) ([]net.IP, error) {
ips := make([]net.IP, 0, len(addrs))
for _, addr := range addrs {
if addr.Family().IsIP() {
ips = append(ips, addr.IP())
} else {
return nil, newError("Failed to convert address", addr, "to Net IP.").AtWarning()
}
}
return ips, nil
}
func toIPOption(s QueryStrategy) dns.IPOption {
return dns.IPOption{
IPv4Enable: s == QueryStrategy_USE_IP || s == QueryStrategy_USE_IP4,
IPv6Enable: s == QueryStrategy_USE_IP || s == QueryStrategy_USE_IP6,
FakeEnable: false,
}
}
func toReqTypes(option dns.IPOption) []dnsmessage.Type {
var reqTypes []dnsmessage.Type
if option.IPv4Enable {
reqTypes = append(reqTypes, dnsmessage.TypeA)
}
if option.IPv6Enable {
reqTypes = append(reqTypes, dnsmessage.TypeAAAA)
}
return reqTypes
}
func generateRandomTag() string {
id := uuid.New()
return "v2ray.system." + id.String()
}
================================================
FILE: app/dns/config.pb.go
================================================
package dns
import (
fakedns "github.com/v2fly/v2ray-core/v5/app/dns/fakedns"
routercommon "github.com/v2fly/v2ray-core/v5/app/router/routercommon"
net "github.com/v2fly/v2ray-core/v5/common/net"
_ "github.com/v2fly/v2ray-core/v5/common/protoext"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type DomainMatchingType int32
const (
DomainMatchingType_Full DomainMatchingType = 0
DomainMatchingType_Subdomain DomainMatchingType = 1
DomainMatchingType_Keyword DomainMatchingType = 2
DomainMatchingType_Regex DomainMatchingType = 3
)
// Enum value maps for DomainMatchingType.
var (
DomainMatchingType_name = map[int32]string{
0: "Full",
1: "Subdomain",
2: "Keyword",
3: "Regex",
}
DomainMatchingType_value = map[string]int32{
"Full": 0,
"Subdomain": 1,
"Keyword": 2,
"Regex": 3,
}
)
func (x DomainMatchingType) Enum() *DomainMatchingType {
p := new(DomainMatchingType)
*p = x
return p
}
func (x DomainMatchingType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (DomainMatchingType) Descriptor() protoreflect.EnumDescriptor {
return file_app_dns_config_proto_enumTypes[0].Descriptor()
}
func (DomainMatchingType) Type() protoreflect.EnumType {
return &file_app_dns_config_proto_enumTypes[0]
}
func (x DomainMatchingType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use DomainMatchingType.Descriptor instead.
func (DomainMatchingType) EnumDescriptor() ([]byte, []int) {
return file_app_dns_config_proto_rawDescGZIP(), []int{0}
}
type QueryStrategy int32
const (
QueryStrategy_USE_IP QueryStrategy = 0
QueryStrategy_USE_IP4 QueryStrategy = 1
QueryStrategy_USE_IP6 QueryStrategy = 2
)
// Enum value maps for QueryStrategy.
var (
QueryStrategy_name = map[int32]string{
0: "USE_IP",
1: "USE_IP4",
2: "USE_IP6",
}
QueryStrategy_value = map[string]int32{
"USE_IP": 0,
"USE_IP4": 1,
"USE_IP6": 2,
}
)
func (x QueryStrategy) Enum() *QueryStrategy {
p := new(QueryStrategy)
*p = x
return p
}
func (x QueryStrategy) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (QueryStrategy) Descriptor() protoreflect.EnumDescriptor {
return file_app_dns_config_proto_enumTypes[1].Descriptor()
}
func (QueryStrategy) Type() protoreflect.EnumType {
return &file_app_dns_config_proto_enumTypes[1]
}
func (x QueryStrategy) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use QueryStrategy.Descriptor instead.
func (QueryStrategy) EnumDescriptor() ([]byte, []int) {
return file_app_dns_config_proto_rawDescGZIP(), []int{1}
}
type CacheStrategy int32
const (
CacheStrategy_CacheEnabled CacheStrategy = 0
CacheStrategy_CacheDisabled CacheStrategy = 1
)
// Enum value maps for CacheStrategy.
var (
CacheStrategy_name = map[int32]string{
0: "CacheEnabled",
1: "CacheDisabled",
}
CacheStrategy_value = map[string]int32{
"CacheEnabled": 0,
"CacheDisabled": 1,
}
)
func (x CacheStrategy) Enum() *CacheStrategy {
p := new(CacheStrategy)
*p = x
return p
}
func (x CacheStrategy) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (CacheStrategy) Descriptor() protoreflect.EnumDescriptor {
return file_app_dns_config_proto_enumTypes[2].Descriptor()
}
func (CacheStrategy) Type() protoreflect.EnumType {
return &file_app_dns_config_proto_enumTypes[2]
}
func (x CacheStrategy) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use CacheStrategy.Descriptor instead.
func (CacheStrategy) EnumDescriptor() ([]byte, []int) {
return file_app_dns_config_proto_rawDescGZIP(), []int{2}
}
type FallbackStrategy int32
const (
FallbackStrategy_Enabled FallbackStrategy = 0
FallbackStrategy_Disabled FallbackStrategy = 1
FallbackStrategy_DisabledIfAnyMatch FallbackStrategy = 2
)
// Enum value maps for FallbackStrategy.
var (
FallbackStrategy_name = map[int32]string{
0: "Enabled",
1: "Disabled",
2: "DisabledIfAnyMatch",
}
FallbackStrategy_value = map[string]int32{
"Enabled": 0,
"Disabled": 1,
"DisabledIfAnyMatch": 2,
}
)
func (x FallbackStrategy) Enum() *FallbackStrategy {
p := new(FallbackStrategy)
*p = x
return p
}
func (x FallbackStrategy) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (FallbackStrategy) Descriptor() protoreflect.EnumDescriptor {
return file_app_dns_config_proto_enumTypes[3].Descriptor()
}
func (FallbackStrategy) Type() protoreflect.EnumType {
return &file_app_dns_config_proto_enumTypes[3]
}
func (x FallbackStrategy) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use FallbackStrategy.Descriptor instead.
func (FallbackStrategy) EnumDescriptor() ([]byte, []int) {
return file_app_dns_config_proto_rawDescGZIP(), []int{3}
}
type NameServer struct {
state protoimpl.MessageState `protogen:"open.v1"`
Address *net.Endpoint `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
ClientIp []byte `protobuf:"bytes,5,opt,name=client_ip,json=clientIp,proto3" json:"client_ip,omitempty"`
Tag string `protobuf:"bytes,7,opt,name=tag,proto3" json:"tag,omitempty"`
PrioritizedDomain []*NameServer_PriorityDomain `protobuf:"bytes,2,rep,name=prioritized_domain,json=prioritizedDomain,proto3" json:"prioritized_domain,omitempty"`
Geoip []*routercommon.GeoIP `protobuf:"bytes,3,rep,name=geoip,proto3" json:"geoip,omitempty"`
OriginalRules []*NameServer_OriginalRule `protobuf:"bytes,4,rep,name=original_rules,json=originalRules,proto3" json:"original_rules,omitempty"`
FakeDns *fakedns.FakeDnsPoolMulti `protobuf:"bytes,11,opt,name=fake_dns,json=fakeDns,proto3" json:"fake_dns,omitempty"`
// Deprecated. Use fallback_strategy.
//
// Deprecated: Marked as deprecated in app/dns/config.proto.
SkipFallback bool `protobuf:"varint,6,opt,name=skipFallback,proto3" json:"skipFallback,omitempty"`
QueryStrategy *QueryStrategy `protobuf:"varint,8,opt,name=query_strategy,json=queryStrategy,proto3,enum=v2ray.core.app.dns.QueryStrategy,oneof" json:"query_strategy,omitempty"`
CacheStrategy *CacheStrategy `protobuf:"varint,9,opt,name=cache_strategy,json=cacheStrategy,proto3,enum=v2ray.core.app.dns.CacheStrategy,oneof" json:"cache_strategy,omitempty"`
FallbackStrategy *FallbackStrategy `protobuf:"varint,10,opt,name=fallback_strategy,json=fallbackStrategy,proto3,enum=v2ray.core.app.dns.FallbackStrategy,oneof" json:"fallback_strategy,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *NameServer) Reset() {
*x = NameServer{}
mi := &file_app_dns_config_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *NameServer) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NameServer) ProtoMessage() {}
func (x *NameServer) ProtoReflect() protoreflect.Message {
mi := &file_app_dns_config_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NameServer.ProtoReflect.Descriptor instead.
func (*NameServer) Descriptor() ([]byte, []int) {
return file_app_dns_config_proto_rawDescGZIP(), []int{0}
}
func (x *NameServer) GetAddress() *net.Endpoint {
if x != nil {
return x.Address
}
return nil
}
func (x *NameServer) GetClientIp() []byte {
if x != nil {
return x.ClientIp
}
return nil
}
func (x *NameServer) GetTag() string {
if x != nil {
return x.Tag
}
return ""
}
func (x *NameServer) GetPrioritizedDomain() []*NameServer_PriorityDomain {
if x != nil {
return x.PrioritizedDomain
}
return nil
}
func (x *NameServer) GetGeoip() []*routercommon.GeoIP {
if x != nil {
return x.Geoip
}
return nil
}
func (x *NameServer) GetOriginalRules() []*NameServer_OriginalRule {
if x != nil {
return x.OriginalRules
}
return nil
}
func (x *NameServer) GetFakeDns() *fakedns.FakeDnsPoolMulti {
if x != nil {
return x.FakeDns
}
return nil
}
// Deprecated: Marked as deprecated in app/dns/config.proto.
func (x *NameServer) GetSkipFallback() bool {
if x != nil {
return x.SkipFallback
}
return false
}
func (x *NameServer) GetQueryStrategy() QueryStrategy {
if x != nil && x.QueryStrategy != nil {
return *x.QueryStrategy
}
return QueryStrategy_USE_IP
}
func (x *NameServer) GetCacheStrategy() CacheStrategy {
if x != nil && x.CacheStrategy != nil {
return *x.CacheStrategy
}
return CacheStrategy_CacheEnabled
}
func (x *NameServer) GetFallbackStrategy() FallbackStrategy {
if x != nil && x.FallbackStrategy != nil {
return *x.FallbackStrategy
}
return FallbackStrategy_Enabled
}
type HostMapping struct {
state protoimpl.MessageState `protogen:"open.v1"`
Type DomainMatchingType `protobuf:"varint,1,opt,name=type,proto3,enum=v2ray.core.app.dns.DomainMatchingType" json:"type,omitempty"`
Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"`
Ip [][]byte `protobuf:"bytes,3,rep,name=ip,proto3" json:"ip,omitempty"`
// ProxiedDomain indicates the mapped domain has the same IP address on this
// domain. V2Ray will use this domain for IP queries.
ProxiedDomain string `protobuf:"bytes,4,opt,name=proxied_domain,json=proxiedDomain,proto3" json:"proxied_domain,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *HostMapping) Reset() {
*x = HostMapping{}
mi := &file_app_dns_config_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *HostMapping) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HostMapping) ProtoMessage() {}
func (x *HostMapping) ProtoReflect() protoreflect.Message {
mi := &file_app_dns_config_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use HostMapping.ProtoReflect.Descriptor instead.
func (*HostMapping) Descriptor() ([]byte, []int) {
return file_app_dns_config_proto_rawDescGZIP(), []int{1}
}
func (x *HostMapping) GetType() DomainMatchingType {
if x != nil {
return x.Type
}
return DomainMatchingType_Full
}
func (x *HostMapping) GetDomain() string {
if x != nil {
return x.Domain
}
return ""
}
func (x *HostMapping) GetIp() [][]byte {
if x != nil {
return x.Ip
}
return nil
}
func (x *HostMapping) GetProxiedDomain() string {
if x != nil {
return x.ProxiedDomain
}
return ""
}
type Config struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Nameservers used by this DNS. Only traditional UDP servers are support at
// the moment. A special value 'localhost' as a domain address can be set to
// use DNS on local system.
//
// Deprecated: Marked as deprecated in app/dns/config.proto.
NameServers []*net.Endpoint `protobuf:"bytes,1,rep,name=NameServers,proto3" json:"NameServers,omitempty"`
// NameServer list used by this DNS client.
NameServer []*NameServer `protobuf:"bytes,5,rep,name=name_server,json=nameServer,proto3" json:"name_server,omitempty"`
// Static hosts. Domain to IP.
// Deprecated. Use static_hosts.
//
// Deprecated: Marked as deprecated in app/dns/config.proto.
Hosts map[string]*net.IPOrDomain `protobuf:"bytes,2,rep,name=Hosts,proto3" json:"Hosts,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
// Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
// (IPv6).
ClientIp []byte `protobuf:"bytes,3,opt,name=client_ip,json=clientIp,proto3" json:"client_ip,omitempty"`
// Static domain-ip mapping in DNS server.
StaticHosts []*HostMapping `protobuf:"bytes,4,rep,name=static_hosts,json=staticHosts,proto3" json:"static_hosts,omitempty"`
// Global fakedns object.
FakeDns *fakedns.FakeDnsPoolMulti `protobuf:"bytes,16,opt,name=fake_dns,json=fakeDns,proto3" json:"fake_dns,omitempty"`
// Tag is the inbound tag of DNS client.
Tag string `protobuf:"bytes,6,opt,name=tag,proto3" json:"tag,omitempty"`
// Domain matcher to use
DomainMatcher string `protobuf:"bytes,15,opt,name=domain_matcher,json=domainMatcher,proto3" json:"domain_matcher,omitempty"`
// DisableCache disables DNS cache
// Deprecated. Use cache_strategy.
//
// Deprecated: Marked as deprecated in app/dns/config.proto.
DisableCache bool `protobuf:"varint,8,opt,name=disableCache,proto3" json:"disableCache,omitempty"`
// Deprecated. Use fallback_strategy.
//
// Deprecated: Marked as deprecated in app/dns/config.proto.
DisableFallback bool `protobuf:"varint,10,opt,name=disableFallback,proto3" json:"disableFallback,omitempty"`
// Deprecated. Use fallback_strategy.
//
// Deprecated: Marked as deprecated in app/dns/config.proto.
DisableFallbackIfMatch bool `protobuf:"varint,11,opt,name=disableFallbackIfMatch,proto3" json:"disableFallbackIfMatch,omitempty"`
// Default query strategy (IPv4, IPv6, or both) for each name server.
QueryStrategy QueryStrategy `protobuf:"varint,9,opt,name=query_strategy,json=queryStrategy,proto3,enum=v2ray.core.app.dns.QueryStrategy" json:"query_strategy,omitempty"`
// Default cache strategy for each name server.
CacheStrategy CacheStrategy `protobuf:"varint,12,opt,name=cache_strategy,json=cacheStrategy,proto3,enum=v2ray.core.app.dns.CacheStrategy" json:"cache_strategy,omitempty"`
// Default fallback strategy for each name server.
FallbackStrategy FallbackStrategy `protobuf:"varint,13,opt,name=fallback_strategy,json=fallbackStrategy,proto3,enum=v2ray.core.app.dns.FallbackStrategy" json:"fallback_strategy,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Config) Reset() {
*x = Config{}
mi := &file_app_dns_config_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Config) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Config) ProtoMessage() {}
func (x *Config) ProtoReflect() protoreflect.Message {
mi := &file_app_dns_config_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Config.ProtoReflect.Descriptor instead.
func (*Config) Descriptor() ([]byte, []int) {
return file_app_dns_config_proto_rawDescGZIP(), []int{2}
}
// Deprecated: Marked as deprecated in app/dns/config.proto.
func (x *Config) GetNameServers() []*net.Endpoint {
if x != nil {
return x.NameServers
}
return nil
}
func (x *Config) GetNameServer() []*NameServer {
if x != nil {
return x.NameServer
}
return nil
}
// Deprecated: Marked as deprecated in app/dns/config.proto.
func (x *Config) GetHosts() map[string]*net.IPOrDomain {
if x != nil {
return x.Hosts
}
return nil
}
func (x *Config) GetClientIp() []byte {
if x != nil {
return x.ClientIp
}
return nil
}
func (x *Config) GetStaticHosts() []*HostMapping {
if x != nil {
return x.StaticHosts
}
return nil
}
func (x *Config) GetFakeDns() *fakedns.FakeDnsPoolMulti {
if x != nil {
return x.FakeDns
}
return nil
}
func (x *Config) GetTag() string {
if x != nil {
return x.Tag
}
return ""
}
func (x *Config) GetDomainMatcher() string {
if x != nil {
return x.DomainMatcher
}
return ""
}
// Deprecated: Marked as deprecated in app/dns/config.proto.
func (x *Config) GetDisableCache() bool {
if x != nil {
return x.DisableCache
}
return false
}
// Deprecated: Marked as deprecated in app/dns/config.proto.
func (x *Config) GetDisableFallback() bool {
if x != nil {
return x.DisableFallback
}
return false
}
// Deprecated: Marked as deprecated in app/dns/config.proto.
func (x *Config) GetDisableFallbackIfMatch() bool {
if x != nil {
return x.DisableFallbackIfMatch
}
return false
}
func (x *Config) GetQueryStrategy() QueryStrategy {
if x != nil {
return x.QueryStrategy
}
return QueryStrategy_USE_IP
}
func (x *Config) GetCacheStrategy() CacheStrategy {
if x != nil {
return x.CacheStrategy
}
return CacheStrategy_CacheEnabled
}
func (x *Config) GetFallbackStrategy() FallbackStrategy {
if x != nil {
return x.FallbackStrategy
}
return FallbackStrategy_Enabled
}
type SimplifiedConfig struct {
state protoimpl.MessageState `protogen:"open.v1"`
// NameServer list used by this DNS client.
NameServer []*SimplifiedNameServer `protobuf:"bytes,5,rep,name=name_server,json=nameServer,proto3" json:"name_server,omitempty"`
// Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
// (IPv6).
ClientIp string `protobuf:"bytes,3,opt,name=client_ip,json=clientIp,proto3" json:"client_ip,omitempty"`
// Static domain-ip mapping in DNS server.
StaticHosts []*SimplifiedHostMapping `protobuf:"bytes,4,rep,name=static_hosts,json=staticHosts,proto3" json:"static_hosts,omitempty"`
// Global fakedns object.
FakeDns *fakedns.FakeDnsPoolMulti `protobuf:"bytes,16,opt,name=fake_dns,json=fakeDns,proto3" json:"fake_dns,omitempty"`
// Tag is the inbound tag of DNS client.
Tag string `protobuf:"bytes,6,opt,name=tag,proto3" json:"tag,omitempty"`
// Domain matcher to use
DomainMatcher string `protobuf:"bytes,15,opt,name=domain_matcher,json=domainMatcher,proto3" json:"domain_matcher,omitempty"`
// DisableCache disables DNS cache
// Deprecated. Use cache_strategy.
//
// Deprecated: Marked as deprecated in app/dns/config.proto.
DisableCache bool `protobuf:"varint,8,opt,name=disableCache,proto3" json:"disableCache,omitempty"`
// Deprecated. Use fallback_strategy.
//
// Deprecated: Marked as deprecated in app/dns/config.proto.
DisableFallback bool `protobuf:"varint,10,opt,name=disableFallback,proto3" json:"disableFallback,omitempty"`
// Deprecated. Use fallback_strategy.
//
// Deprecated: Marked as deprecated in app/dns/config.proto.
DisableFallbackIfMatch bool `protobuf:"varint,11,opt,name=disableFallbackIfMatch,proto3" json:"disableFallbackIfMatch,omitempty"`
// Default query strategy (IPv4, IPv6, or both) for each name server.
QueryStrategy QueryStrategy `protobuf:"varint,9,opt,name=query_strategy,json=queryStrategy,proto3,enum=v2ray.core.app.dns.QueryStrategy" json:"query_strategy,omitempty"`
// Default cache strategy for each name server.
CacheStrategy CacheStrategy `protobuf:"varint,12,opt,name=cache_strategy,json=cacheStrategy,proto3,enum=v2ray.core.app.dns.CacheStrategy" json:"cache_strategy,omitempty"`
// Default fallback strategy for each name server.
FallbackStrategy FallbackStrategy `protobuf:"varint,13,opt,name=fallback_strategy,json=fallbackStrategy,proto3,enum=v2ray.core.app.dns.FallbackStrategy" json:"fallback_strategy,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SimplifiedConfig) Reset() {
*x = SimplifiedConfig{}
mi := &file_app_dns_config_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SimplifiedConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SimplifiedConfig) ProtoMessage() {}
func (x *SimplifiedConfig) ProtoReflect() protoreflect.Message {
mi := &file_app_dns_config_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SimplifiedConfig.ProtoReflect.Descriptor instead.
func (*SimplifiedConfig) Descriptor() ([]byte, []int) {
return file_app_dns_config_proto_rawDescGZIP(), []int{3}
}
func (x *SimplifiedConfig) GetNameServer() []*SimplifiedNameServer {
if x != nil {
return x.NameServer
}
return nil
}
func (x *SimplifiedConfig) GetClientIp() string {
if x != nil {
return x.ClientIp
}
return ""
}
func (x *SimplifiedConfig) GetStaticHosts() []*SimplifiedHostMapping {
if x != nil {
return x.StaticHosts
}
return nil
}
func (x *SimplifiedConfig) GetFakeDns() *fakedns.FakeDnsPoolMulti {
if x != nil {
return x.FakeDns
}
return nil
}
func (x *SimplifiedConfig) GetTag() string {
if x != nil {
return x.Tag
}
return ""
}
func (x *SimplifiedConfig) GetDomainMatcher() string {
if x != nil {
return x.DomainMatcher
}
return ""
}
// Deprecated: Marked as deprecated in app/dns/config.proto.
func (x *SimplifiedConfig) GetDisableCache() bool {
if x != nil {
return x.DisableCache
}
return false
}
// Deprecated: Marked as deprecated in app/dns/config.proto.
func (x *SimplifiedConfig) GetDisableFallback() bool {
if x != nil {
return x.DisableFallback
}
return false
}
// Deprecated: Marked as deprecated in app/dns/config.proto.
func (x *SimplifiedConfig) GetDisableFallbackIfMatch() bool {
if x != nil {
return x.DisableFallbackIfMatch
}
return false
}
func (x *SimplifiedConfig) GetQueryStrategy() QueryStrategy {
if x != nil {
return x.QueryStrategy
}
return QueryStrategy_USE_IP
}
func (x *SimplifiedConfig) GetCacheStrategy() CacheStrategy {
if x != nil {
return x.CacheStrategy
}
return CacheStrategy_CacheEnabled
}
func (x *SimplifiedConfig) GetFallbackStrategy() FallbackStrategy {
if x != nil {
return x.FallbackStrategy
}
return FallbackStrategy_Enabled
}
type SimplifiedHostMapping struct {
state protoimpl.MessageState `protogen:"open.v1"`
Type DomainMatchingType `protobuf:"varint,1,opt,name=type,proto3,enum=v2ray.core.app.dns.DomainMatchingType" json:"type,omitempty"`
Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"`
Ip []string `protobuf:"bytes,3,rep,name=ip,proto3" json:"ip,omitempty"`
// ProxiedDomain indicates the mapped domain has the same IP address on this
// domain. V2Ray will use this domain for IP queries.
ProxiedDomain string `protobuf:"bytes,4,opt,name=proxied_domain,json=proxiedDomain,proto3" json:"proxied_domain,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SimplifiedHostMapping) Reset() {
*x = SimplifiedHostMapping{}
mi := &file_app_dns_config_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SimplifiedHostMapping) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SimplifiedHostMapping) ProtoMessage() {}
func (x *SimplifiedHostMapping) ProtoReflect() protoreflect.Message {
mi := &file_app_dns_config_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SimplifiedHostMapping.ProtoReflect.Descriptor instead.
func (*SimplifiedHostMapping) Descriptor() ([]byte, []int) {
return file_app_dns_config_proto_rawDescGZIP(), []int{4}
}
func (x *SimplifiedHostMapping) GetType() DomainMatchingType {
if x != nil {
return x.Type
}
return DomainMatchingType_Full
}
func (x *SimplifiedHostMapping) GetDomain() string {
if x != nil {
return x.Domain
}
return ""
}
func (x *SimplifiedHostMapping) GetIp() []string {
if x != nil {
return x.Ip
}
return nil
}
func (x *SimplifiedHostMapping) GetProxiedDomain() string {
if x != nil {
return x.ProxiedDomain
}
return ""
}
type SimplifiedNameServer struct {
state protoimpl.MessageState `protogen:"open.v1"`
Address *net.Endpoint `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
ClientIp string `protobuf:"bytes,5,opt,name=client_ip,json=clientIp,proto3" json:"client_ip,omitempty"`
Tag string `protobuf:"bytes,7,opt,name=tag,proto3" json:"tag,omitempty"`
PrioritizedDomain []*SimplifiedNameServer_PriorityDomain `protobuf:"bytes,2,rep,name=prioritized_domain,json=prioritizedDomain,proto3" json:"prioritized_domain,omitempty"`
Geoip []*routercommon.GeoIP `protobuf:"bytes,3,rep,name=geoip,proto3" json:"geoip,omitempty"`
OriginalRules []*SimplifiedNameServer_OriginalRule `protobuf:"bytes,4,rep,name=original_rules,json=originalRules,proto3" json:"original_rules,omitempty"`
FakeDns *fakedns.FakeDnsPoolMulti `protobuf:"bytes,11,opt,name=fake_dns,json=fakeDns,proto3" json:"fake_dns,omitempty"`
// Deprecated. Use fallback_strategy.
//
// Deprecated: Marked as deprecated in app/dns/config.proto.
SkipFallback bool `protobuf:"varint,6,opt,name=skipFallback,proto3" json:"skipFallback,omitempty"`
QueryStrategy *QueryStrategy `protobuf:"varint,8,opt,name=query_strategy,json=queryStrategy,proto3,enum=v2ray.core.app.dns.QueryStrategy,oneof" json:"query_strategy,omitempty"`
CacheStrategy *CacheStrategy `protobuf:"varint,9,opt,name=cache_strategy,json=cacheStrategy,proto3,enum=v2ray.core.app.dns.CacheStrategy,oneof" json:"cache_strategy,omitempty"`
FallbackStrategy *FallbackStrategy `protobuf:"varint,10,opt,name=fallback_strategy,json=fallbackStrategy,proto3,enum=v2ray.core.app.dns.FallbackStrategy,oneof" json:"fallback_strategy,omitempty"`
GeoDomain []*routercommon.GeoSite `protobuf:"bytes,68001,rep,name=geo_domain,json=geoDomain,proto3" json:"geo_domain,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SimplifiedNameServer) Reset() {
*x = SimplifiedNameServer{}
mi := &file_app_dns_config_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SimplifiedNameServer) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SimplifiedNameServer) ProtoMessage() {}
func (x *SimplifiedNameServer) ProtoReflect() protoreflect.Message {
mi := &file_app_dns_config_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SimplifiedNameServer.ProtoReflect.Descriptor instead.
func (*SimplifiedNameServer) Descriptor() ([]byte, []int) {
return file_app_dns_config_proto_rawDescGZIP(), []int{5}
}
func (x *SimplifiedNameServer) GetAddress() *net.Endpoint {
if x != nil {
return x.Address
}
return nil
}
func (x *SimplifiedNameServer) GetClientIp() string {
if x != nil {
return x.ClientIp
}
return ""
}
func (x *SimplifiedNameServer) GetTag() string {
if x != nil {
return x.Tag
}
return ""
}
func (x *SimplifiedNameServer) GetPrioritizedDomain() []*SimplifiedNameServer_PriorityDomain {
if x != nil {
return x.PrioritizedDomain
}
return nil
}
func (x *SimplifiedNameServer) GetGeoip() []*routercommon.GeoIP {
if x != nil {
return x.Geoip
}
return nil
}
func (x *SimplifiedNameServer) GetOriginalRules() []*SimplifiedNameServer_OriginalRule {
if x != nil {
return x.OriginalRules
}
return nil
}
func (x *SimplifiedNameServer) GetFakeDns() *fakedns.FakeDnsPoolMulti {
if x != nil {
return x.FakeDns
}
return nil
}
// Deprecated: Marked as deprecated in app/dns/config.proto.
func (x *SimplifiedNameServer) GetSkipFallback() bool {
if x != nil {
return x.SkipFallback
}
return false
}
func (x *SimplifiedNameServer) GetQueryStrategy() QueryStrategy {
if x != nil && x.QueryStrategy != nil {
return *x.QueryStrategy
}
return QueryStrategy_USE_IP
}
func (x *SimplifiedNameServer) GetCacheStrategy() CacheStrategy {
if x != nil && x.CacheStrategy != nil {
return *x.CacheStrategy
}
return CacheStrategy_CacheEnabled
}
func (x *SimplifiedNameServer) GetFallbackStrategy() FallbackStrategy {
if x != nil && x.FallbackStrategy != nil {
return *x.FallbackStrategy
}
return FallbackStrategy_Enabled
}
func (x *SimplifiedNameServer) GetGeoDomain() []*routercommon.GeoSite {
if x != nil {
return x.GeoDomain
}
return nil
}
type NameServer_PriorityDomain struct {
state protoimpl.MessageState `protogen:"open.v1"`
Type DomainMatchingType `protobuf:"varint,1,opt,name=type,proto3,enum=v2ray.core.app.dns.DomainMatchingType" json:"type,omitempty"`
Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *NameServer_PriorityDomain) Reset() {
*x = NameServer_PriorityDomain{}
mi := &file_app_dns_config_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *NameServer_PriorityDomain) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NameServer_PriorityDomain) ProtoMessage() {}
func (x *NameServer_PriorityDomain) ProtoReflect() protoreflect.Message {
mi := &file_app_dns_config_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NameServer_PriorityDomain.ProtoReflect.Descriptor instead.
func (*NameServer_PriorityDomain) Descriptor() ([]byte, []int) {
return file_app_dns_config_proto_rawDescGZIP(), []int{0, 0}
}
func (x *NameServer_PriorityDomain) GetType() DomainMatchingType {
if x != nil {
return x.Type
}
return DomainMatchingType_Full
}
func (x *NameServer_PriorityDomain) GetDomain() string {
if x != nil {
return x.Domain
}
return ""
}
type NameServer_OriginalRule struct {
state protoimpl.MessageState `protogen:"open.v1"`
Rule string `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"`
Size uint32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *NameServer_OriginalRule) Reset() {
*x = NameServer_OriginalRule{}
mi := &file_app_dns_config_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *NameServer_OriginalRule) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NameServer_OriginalRule) ProtoMessage() {}
func (x *NameServer_OriginalRule) ProtoReflect() protoreflect.Message {
mi := &file_app_dns_config_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NameServer_OriginalRule.ProtoReflect.Descriptor instead.
func (*NameServer_OriginalRule) Descriptor() ([]byte, []int) {
return file_app_dns_config_proto_rawDescGZIP(), []int{0, 1}
}
func (x *NameServer_OriginalRule) GetRule() string {
if x != nil {
return x.Rule
}
return ""
}
func (x *NameServer_OriginalRule) GetSize() uint32 {
if x != nil {
return x.Size
}
return 0
}
type SimplifiedNameServer_PriorityDomain struct {
state protoimpl.MessageState `protogen:"open.v1"`
Type DomainMatchingType `protobuf:"varint,1,opt,name=type,proto3,enum=v2ray.core.app.dns.DomainMatchingType" json:"type,omitempty"`
Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SimplifiedNameServer_PriorityDomain) Reset() {
*x = SimplifiedNameServer_PriorityDomain{}
mi := &file_app_dns_config_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SimplifiedNameServer_PriorityDomain) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SimplifiedNameServer_PriorityDomain) ProtoMessage() {}
func (x *SimplifiedNameServer_PriorityDomain) ProtoReflect() protoreflect.Message {
mi := &file_app_dns_config_proto_msgTypes[9]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SimplifiedNameServer_PriorityDomain.ProtoReflect.Descriptor instead.
func (*SimplifiedNameServer_PriorityDomain) Descriptor() ([]byte, []int) {
return file_app_dns_config_proto_rawDescGZIP(), []int{5, 0}
}
func (x *SimplifiedNameServer_PriorityDomain) GetType() DomainMatchingType {
if x != nil {
return x.Type
}
return DomainMatchingType_Full
}
func (x *SimplifiedNameServer_PriorityDomain) GetDomain() string {
if x != nil {
return x.Domain
}
return ""
}
type SimplifiedNameServer_OriginalRule struct {
state protoimpl.MessageState `protogen:"open.v1"`
Rule string `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"`
Size uint32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SimplifiedNameServer_OriginalRule) Reset() {
*x = SimplifiedNameServer_OriginalRule{}
mi := &file_app_dns_config_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SimplifiedNameServer_OriginalRule) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SimplifiedNameServer_OriginalRule) ProtoMessage() {}
func (x *SimplifiedNameServer_OriginalRule) ProtoReflect() protoreflect.Message {
mi := &file_app_dns_config_proto_msgTypes[10]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SimplifiedNameServer_OriginalRule.ProtoReflect.Descriptor instead.
func (*SimplifiedNameServer_OriginalRule) Descriptor() ([]byte, []int) {
return file_app_dns_config_proto_rawDescGZIP(), []int{5, 1}
}
func (x *SimplifiedNameServer_OriginalRule) GetRule() string {
if x != nil {
return x.Rule
}
return ""
}
func (x *SimplifiedNameServer_OriginalRule) GetSize() uint32 {
if x != nil {
return x.Size
}
return 0
}
var File_app_dns_config_proto protoreflect.FileDescriptor
const file_app_dns_config_proto_rawDesc = "" +
"\n" +
"\x14app/dns/config.proto\x12\x12v2ray.core.app.dns\x1a\x18common/net/address.proto\x1a\x1ccommon/net/destination.proto\x1a$app/router/routercommon/common.proto\x1a\x1dapp/dns/fakedns/fakedns.proto\x1a common/protoext/extensions.proto\"\xaa\a\n" +
"\n" +
"NameServer\x129\n" +
"\aaddress\x18\x01 \x01(\v2\x1f.v2ray.core.common.net.EndpointR\aaddress\x12\x1b\n" +
"\tclient_ip\x18\x05 \x01(\fR\bclientIp\x12\x10\n" +
"\x03tag\x18\a \x01(\tR\x03tag\x12\\\n" +
"\x12prioritized_domain\x18\x02 \x03(\v2-.v2ray.core.app.dns.NameServer.PriorityDomainR\x11prioritizedDomain\x12?\n" +
"\x05geoip\x18\x03 \x03(\v2).v2ray.core.app.router.routercommon.GeoIPR\x05geoip\x12R\n" +
"\x0eoriginal_rules\x18\x04 \x03(\v2+.v2ray.core.app.dns.NameServer.OriginalRuleR\roriginalRules\x12G\n" +
"\bfake_dns\x18\v \x01(\v2,.v2ray.core.app.dns.fakedns.FakeDnsPoolMultiR\afakeDns\x12&\n" +
"\fskipFallback\x18\x06 \x01(\bB\x02\x18\x01R\fskipFallback\x12M\n" +
"\x0equery_strategy\x18\b \x01(\x0e2!.v2ray.core.app.dns.QueryStrategyH\x00R\rqueryStrategy\x88\x01\x01\x12M\n" +
"\x0ecache_strategy\x18\t \x01(\x0e2!.v2ray.core.app.dns.CacheStrategyH\x01R\rcacheStrategy\x88\x01\x01\x12V\n" +
"\x11fallback_strategy\x18\n" +
" \x01(\x0e2$.v2ray.core.app.dns.FallbackStrategyH\x02R\x10fallbackStrategy\x88\x01\x01\x1ad\n" +
"\x0ePriorityDomain\x12:\n" +
"\x04type\x18\x01 \x01(\x0e2&.v2ray.core.app.dns.DomainMatchingTypeR\x04type\x12\x16\n" +
"\x06domain\x18\x02 \x01(\tR\x06domain\x1a6\n" +
"\fOriginalRule\x12\x12\n" +
"\x04rule\x18\x01 \x01(\tR\x04rule\x12\x12\n" +
"\x04size\x18\x02 \x01(\rR\x04sizeB\x11\n" +
"\x0f_query_strategyB\x11\n" +
"\x0f_cache_strategyB\x14\n" +
"\x12_fallback_strategy\"\x98\x01\n" +
"\vHostMapping\x12:\n" +
"\x04type\x18\x01 \x01(\x0e2&.v2ray.core.app.dns.DomainMatchingTypeR\x04type\x12\x16\n" +
"\x06domain\x18\x02 \x01(\tR\x06domain\x12\x0e\n" +
"\x02ip\x18\x03 \x03(\fR\x02ip\x12%\n" +
"\x0eproxied_domain\x18\x04 \x01(\tR\rproxiedDomain\"\x90\a\n" +
"\x06Config\x12E\n" +
"\vNameServers\x18\x01 \x03(\v2\x1f.v2ray.core.common.net.EndpointB\x02\x18\x01R\vNameServers\x12?\n" +
"\vname_server\x18\x05 \x03(\v2\x1e.v2ray.core.app.dns.NameServerR\n" +
"nameServer\x12?\n" +
"\x05Hosts\x18\x02 \x03(\v2%.v2ray.core.app.dns.Config.HostsEntryB\x02\x18\x01R\x05Hosts\x12\x1b\n" +
"\tclient_ip\x18\x03 \x01(\fR\bclientIp\x12B\n" +
"\fstatic_hosts\x18\x04 \x03(\v2\x1f.v2ray.core.app.dns.HostMappingR\vstaticHosts\x12G\n" +
"\bfake_dns\x18\x10 \x01(\v2,.v2ray.core.app.dns.fakedns.FakeDnsPoolMultiR\afakeDns\x12\x10\n" +
"\x03tag\x18\x06 \x01(\tR\x03tag\x12%\n" +
"\x0edomain_matcher\x18\x0f \x01(\tR\rdomainMatcher\x12&\n" +
"\fdisableCache\x18\b \x01(\bB\x02\x18\x01R\fdisableCache\x12,\n" +
"\x0fdisableFallback\x18\n" +
" \x01(\bB\x02\x18\x01R\x0fdisableFallback\x12:\n" +
"\x16disableFallbackIfMatch\x18\v \x01(\bB\x02\x18\x01R\x16disableFallbackIfMatch\x12H\n" +
"\x0equery_strategy\x18\t \x01(\x0e2!.v2ray.core.app.dns.QueryStrategyR\rqueryStrategy\x12H\n" +
"\x0ecache_strategy\x18\f \x01(\x0e2!.v2ray.core.app.dns.CacheStrategyR\rcacheStrategy\x12Q\n" +
"\x11fallback_strategy\x18\r \x01(\x0e2$.v2ray.core.app.dns.FallbackStrategyR\x10fallbackStrategy\x1a[\n" +
"\n" +
"HostsEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x127\n" +
"\x05value\x18\x02 \x01(\v2!.v2ray.core.common.net.IPOrDomainR\x05value:\x028\x01J\x04\b\a\x10\b\"\xe9\x05\n" +
"\x10SimplifiedConfig\x12I\n" +
"\vname_server\x18\x05 \x03(\v2(.v2ray.core.app.dns.SimplifiedNameServerR\n" +
"nameServer\x12\x1b\n" +
"\tclient_ip\x18\x03 \x01(\tR\bclientIp\x12L\n" +
"\fstatic_hosts\x18\x04 \x03(\v2).v2ray.core.app.dns.SimplifiedHostMappingR\vstaticHosts\x12G\n" +
"\bfake_dns\x18\x10 \x01(\v2,.v2ray.core.app.dns.fakedns.FakeDnsPoolMultiR\afakeDns\x12\x10\n" +
"\x03tag\x18\x06 \x01(\tR\x03tag\x12%\n" +
"\x0edomain_matcher\x18\x0f \x01(\tR\rdomainMatcher\x12&\n" +
"\fdisableCache\x18\b \x01(\bB\x02\x18\x01R\fdisableCache\x12,\n" +
"\x0fdisableFallback\x18\n" +
" \x01(\bB\x02\x18\x01R\x0fdisableFallback\x12:\n" +
"\x16disableFallbackIfMatch\x18\v \x01(\bB\x02\x18\x01R\x16disableFallbackIfMatch\x12H\n" +
"\x0equery_strategy\x18\t \x01(\x0e2!.v2ray.core.app.dns.QueryStrategyR\rqueryStrategy\x12H\n" +
"\x0ecache_strategy\x18\f \x01(\x0e2!.v2ray.core.app.dns.CacheStrategyR\rcacheStrategy\x12Q\n" +
"\x11fallback_strategy\x18\r \x01(\x0e2$.v2ray.core.app.dns.FallbackStrategyR\x10fallbackStrategy:\x12\x82\xb5\x18\x0e\n" +
"\aservice\x12\x03dnsJ\x04\b\x01\x10\x02J\x04\b\x02\x10\x03J\x04\b\a\x10\b\"\xa2\x01\n" +
"\x15SimplifiedHostMapping\x12:\n" +
"\x04type\x18\x01 \x01(\x0e2&.v2ray.core.app.dns.DomainMatchingTypeR\x04type\x12\x16\n" +
"\x06domain\x18\x02 \x01(\tR\x06domain\x12\x0e\n" +
"\x02ip\x18\x03 \x03(\tR\x02ip\x12%\n" +
"\x0eproxied_domain\x18\x04 \x01(\tR\rproxiedDomain\"\x96\b\n" +
"\x14SimplifiedNameServer\x129\n" +
"\aaddress\x18\x01 \x01(\v2\x1f.v2ray.core.common.net.EndpointR\aaddress\x12\x1b\n" +
"\tclient_ip\x18\x05 \x01(\tR\bclientIp\x12\x10\n" +
"\x03tag\x18\a \x01(\tR\x03tag\x12f\n" +
"\x12prioritized_domain\x18\x02 \x03(\v27.v2ray.core.app.dns.SimplifiedNameServer.PriorityDomainR\x11prioritizedDomain\x12?\n" +
"\x05geoip\x18\x03 \x03(\v2).v2ray.core.app.router.routercommon.GeoIPR\x05geoip\x12\\\n" +
"\x0eoriginal_rules\x18\x04 \x03(\v25.v2ray.core.app.dns.SimplifiedNameServer.OriginalRuleR\roriginalRules\x12G\n" +
"\bfake_dns\x18\v \x01(\v2,.v2ray.core.app.dns.fakedns.FakeDnsPoolMultiR\afakeDns\x12&\n" +
"\fskipFallback\x18\x06 \x01(\bB\x02\x18\x01R\fskipFallback\x12M\n" +
"\x0equery_strategy\x18\b \x01(\x0e2!.v2ray.core.app.dns.QueryStrategyH\x00R\rqueryStrategy\x88\x01\x01\x12M\n" +
"\x0ecache_strategy\x18\t \x01(\x0e2!.v2ray.core.app.dns.CacheStrategyH\x01R\rcacheStrategy\x88\x01\x01\x12V\n" +
"\x11fallback_strategy\x18\n" +
" \x01(\x0e2$.v2ray.core.app.dns.FallbackStrategyH\x02R\x10fallbackStrategy\x88\x01\x01\x12L\n" +
"\n" +
"geo_domain\x18\xa1\x93\x04 \x03(\v2+.v2ray.core.app.router.routercommon.GeoSiteR\tgeoDomain\x1ad\n" +
"\x0ePriorityDomain\x12:\n" +
"\x04type\x18\x01 \x01(\x0e2&.v2ray.core.app.dns.DomainMatchingTypeR\x04type\x12\x16\n" +
"\x06domain\x18\x02 \x01(\tR\x06domain\x1a6\n" +
"\fOriginalRule\x12\x12\n" +
"\x04rule\x18\x01 \x01(\tR\x04rule\x12\x12\n" +
"\x04size\x18\x02 \x01(\rR\x04sizeB\x11\n" +
"\x0f_query_strategyB\x11\n" +
"\x0f_cache_strategyB\x14\n" +
"\x12_fallback_strategy*E\n" +
"\x12DomainMatchingType\x12\b\n" +
"\x04Full\x10\x00\x12\r\n" +
"\tSubdomain\x10\x01\x12\v\n" +
"\aKeyword\x10\x02\x12\t\n" +
"\x05Regex\x10\x03*5\n" +
"\rQueryStrategy\x12\n" +
"\n" +
"\x06USE_IP\x10\x00\x12\v\n" +
"\aUSE_IP4\x10\x01\x12\v\n" +
"\aUSE_IP6\x10\x02*4\n" +
"\rCacheStrategy\x12\x10\n" +
"\fCacheEnabled\x10\x00\x12\x11\n" +
"\rCacheDisabled\x10\x01*E\n" +
"\x10FallbackStrategy\x12\v\n" +
"\aEnabled\x10\x00\x12\f\n" +
"\bDisabled\x10\x01\x12\x16\n" +
"\x12DisabledIfAnyMatch\x10\x02BW\n" +
"\x16com.v2ray.core.app.dnsP\x01Z&github.com/v2fly/v2ray-core/v5/app/dns\xaa\x02\x12V2Ray.Core.App.Dnsb\x06proto3"
var (
file_app_dns_config_proto_rawDescOnce sync.Once
file_app_dns_config_proto_rawDescData []byte
)
func file_app_dns_config_proto_rawDescGZIP() []byte {
file_app_dns_config_proto_rawDescOnce.Do(func() {
file_app_dns_config_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_app_dns_config_proto_rawDesc), len(file_app_dns_config_proto_rawDesc)))
})
return file_app_dns_config_proto_rawDescData
}
var file_app_dns_config_proto_enumTypes = make([]protoimpl.EnumInfo, 4)
var file_app_dns_config_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_app_dns_config_proto_goTypes = []any{
(DomainMatchingType)(0), // 0: v2ray.core.app.dns.DomainMatchingType
(QueryStrategy)(0), // 1: v2ray.core.app.dns.QueryStrategy
(CacheStrategy)(0), // 2: v2ray.core.app.dns.CacheStrategy
(FallbackStrategy)(0), // 3: v2ray.core.app.dns.FallbackStrategy
(*NameServer)(nil), // 4: v2ray.core.app.dns.NameServer
(*HostMapping)(nil), // 5: v2ray.core.app.dns.HostMapping
(*Config)(nil), // 6: v2ray.core.app.dns.Config
(*SimplifiedConfig)(nil), // 7: v2ray.core.app.dns.SimplifiedConfig
(*SimplifiedHostMapping)(nil), // 8: v2ray.core.app.dns.SimplifiedHostMapping
(*SimplifiedNameServer)(nil), // 9: v2ray.core.app.dns.SimplifiedNameServer
(*NameServer_PriorityDomain)(nil), // 10: v2ray.core.app.dns.NameServer.PriorityDomain
(*NameServer_OriginalRule)(nil), // 11: v2ray.core.app.dns.NameServer.OriginalRule
nil, // 12: v2ray.core.app.dns.Config.HostsEntry
(*SimplifiedNameServer_PriorityDomain)(nil), // 13: v2ray.core.app.dns.SimplifiedNameServer.PriorityDomain
(*SimplifiedNameServer_OriginalRule)(nil), // 14: v2ray.core.app.dns.SimplifiedNameServer.OriginalRule
(*net.Endpoint)(nil), // 15: v2ray.core.common.net.Endpoint
(*routercommon.GeoIP)(nil), // 16: v2ray.core.app.router.routercommon.GeoIP
(*fakedns.FakeDnsPoolMulti)(nil), // 17: v2ray.core.app.dns.fakedns.FakeDnsPoolMulti
(*routercommon.GeoSite)(nil), // 18: v2ray.core.app.router.routercommon.GeoSite
(*net.IPOrDomain)(nil), // 19: v2ray.core.common.net.IPOrDomain
}
var file_app_dns_config_proto_depIdxs = []int32{
15, // 0: v2ray.core.app.dns.NameServer.address:type_name -> v2ray.core.common.net.Endpoint
10, // 1: v2ray.core.app.dns.NameServer.prioritized_domain:type_name -> v2ray.core.app.dns.NameServer.PriorityDomain
16, // 2: v2ray.core.app.dns.NameServer.geoip:type_name -> v2ray.core.app.router.routercommon.GeoIP
11, // 3: v2ray.core.app.dns.NameServer.original_rules:type_name -> v2ray.core.app.dns.NameServer.OriginalRule
17, // 4: v2ray.core.app.dns.NameServer.fake_dns:type_name -> v2ray.core.app.dns.fakedns.FakeDnsPoolMulti
1, // 5: v2ray.core.app.dns.NameServer.query_strategy:type_name -> v2ray.core.app.dns.QueryStrategy
2, // 6: v2ray.core.app.dns.NameServer.cache_strategy:type_name -> v2ray.core.app.dns.CacheStrategy
3, // 7: v2ray.core.app.dns.NameServer.fallback_strategy:type_name -> v2ray.core.app.dns.FallbackStrategy
0, // 8: v2ray.core.app.dns.HostMapping.type:type_name -> v2ray.core.app.dns.DomainMatchingType
15, // 9: v2ray.core.app.dns.Config.NameServers:type_name -> v2ray.core.common.net.Endpoint
4, // 10: v2ray.core.app.dns.Config.name_server:type_name -> v2ray.core.app.dns.NameServer
12, // 11: v2ray.core.app.dns.Config.Hosts:type_name -> v2ray.core.app.dns.Config.HostsEntry
5, // 12: v2ray.core.app.dns.Config.static_hosts:type_name -> v2ray.core.app.dns.HostMapping
17, // 13: v2ray.core.app.dns.Config.fake_dns:type_name -> v2ray.core.app.dns.fakedns.FakeDnsPoolMulti
1, // 14: v2ray.core.app.dns.Config.query_strategy:type_name -> v2ray.core.app.dns.QueryStrategy
2, // 15: v2ray.core.app.dns.Config.cache_strategy:type_name -> v2ray.core.app.dns.CacheStrategy
3, // 16: v2ray.core.app.dns.Config.fallback_strategy:type_name -> v2ray.core.app.dns.FallbackStrategy
9, // 17: v2ray.core.app.dns.SimplifiedConfig.name_server:type_name -> v2ray.core.app.dns.SimplifiedNameServer
8, // 18: v2ray.core.app.dns.SimplifiedConfig.static_hosts:type_name -> v2ray.core.app.dns.SimplifiedHostMapping
17, // 19: v2ray.core.app.dns.SimplifiedConfig.fake_dns:type_name -> v2ray.core.app.dns.fakedns.FakeDnsPoolMulti
1, // 20: v2ray.core.app.dns.SimplifiedConfig.query_strategy:type_name -> v2ray.core.app.dns.QueryStrategy
2, // 21: v2ray.core.app.dns.SimplifiedConfig.cache_strategy:type_name -> v2ray.core.app.dns.CacheStrategy
3, // 22: v2ray.core.app.dns.SimplifiedConfig.fallback_strategy:type_name -> v2ray.core.app.dns.FallbackStrategy
0, // 23: v2ray.core.app.dns.SimplifiedHostMapping.type:type_name -> v2ray.core.app.dns.DomainMatchingType
15, // 24: v2ray.core.app.dns.SimplifiedNameServer.address:type_name -> v2ray.core.common.net.Endpoint
13, // 25: v2ray.core.app.dns.SimplifiedNameServer.prioritized_domain:type_name -> v2ray.core.app.dns.SimplifiedNameServer.PriorityDomain
16, // 26: v2ray.core.app.dns.SimplifiedNameServer.geoip:type_name -> v2ray.core.app.router.routercommon.GeoIP
14, // 27: v2ray.core.app.dns.SimplifiedNameServer.original_rules:type_name -> v2ray.core.app.dns.SimplifiedNameServer.OriginalRule
17, // 28: v2ray.core.app.dns.SimplifiedNameServer.fake_dns:type_name -> v2ray.core.app.dns.fakedns.FakeDnsPoolMulti
1, // 29: v2ray.core.app.dns.SimplifiedNameServer.query_strategy:type_name -> v2ray.core.app.dns.QueryStrategy
2, // 30: v2ray.core.app.dns.SimplifiedNameServer.cache_strategy:type_name -> v2ray.core.app.dns.CacheStrategy
3, // 31: v2ray.core.app.dns.SimplifiedNameServer.fallback_strategy:type_name -> v2ray.core.app.dns.FallbackStrategy
18, // 32: v2ray.core.app.dns.SimplifiedNameServer.geo_domain:type_name -> v2ray.core.app.router.routercommon.GeoSite
0, // 33: v2ray.core.app.dns.NameServer.PriorityDomain.type:type_name -> v2ray.core.app.dns.DomainMatchingType
19, // 34: v2ray.core.app.dns.Config.HostsEntry.value:type_name -> v2ray.core.common.net.IPOrDomain
0, // 35: v2ray.core.app.dns.SimplifiedNameServer.PriorityDomain.type:type_name -> v2ray.core.app.dns.DomainMatchingType
36, // [36:36] is the sub-list for method output_type
36, // [36:36] is the sub-list for method input_type
36, // [36:36] is the sub-list for extension type_name
36, // [36:36] is the sub-list for extension extendee
0, // [0:36] is the sub-list for field type_name
}
func init() { file_app_dns_config_proto_init() }
func file_app_dns_config_proto_init() {
if File_app_dns_config_proto != nil {
return
}
file_app_dns_config_proto_msgTypes[0].OneofWrappers = []any{}
file_app_dns_config_proto_msgTypes[5].OneofWrappers = []any{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_app_dns_config_proto_rawDesc), len(file_app_dns_config_proto_rawDesc)),
NumEnums: 4,
NumMessages: 11,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_app_dns_config_proto_goTypes,
DependencyIndexes: file_app_dns_config_proto_depIdxs,
EnumInfos: file_app_dns_config_proto_enumTypes,
MessageInfos: file_app_dns_config_proto_msgTypes,
}.Build()
File_app_dns_config_proto = out.File
file_app_dns_config_proto_goTypes = nil
file_app_dns_config_proto_depIdxs = nil
}
================================================
FILE: app/dns/config.proto
================================================
syntax = "proto3";
package v2ray.core.app.dns;
option csharp_namespace = "V2Ray.Core.App.Dns";
option go_package = "github.com/v2fly/v2ray-core/v5/app/dns";
option java_package = "com.v2ray.core.app.dns";
option java_multiple_files = true;
import "common/net/address.proto";
import "common/net/destination.proto";
import "app/router/routercommon/common.proto";
import "app/dns/fakedns/fakedns.proto";
import "common/protoext/extensions.proto";
message NameServer {
v2ray.core.common.net.Endpoint address = 1;
bytes client_ip = 5;
string tag = 7;
message PriorityDomain {
DomainMatchingType type = 1;
string domain = 2;
}
message OriginalRule {
string rule = 1;
uint32 size = 2;
}
repeated PriorityDomain prioritized_domain = 2;
repeated v2ray.core.app.router.routercommon.GeoIP geoip = 3;
repeated OriginalRule original_rules = 4;
v2ray.core.app.dns.fakedns.FakeDnsPoolMulti fake_dns = 11;
// Deprecated. Use fallback_strategy.
bool skipFallback = 6 [deprecated = true];
optional QueryStrategy query_strategy = 8;
optional CacheStrategy cache_strategy = 9;
optional FallbackStrategy fallback_strategy = 10;
}
enum DomainMatchingType {
Full = 0;
Subdomain = 1;
Keyword = 2;
Regex = 3;
}
enum QueryStrategy {
USE_IP = 0;
USE_IP4 = 1;
USE_IP6 = 2;
}
enum CacheStrategy {
CacheEnabled = 0;
CacheDisabled = 1;
}
enum FallbackStrategy {
Enabled = 0;
Disabled = 1;
DisabledIfAnyMatch = 2;
}
message HostMapping {
DomainMatchingType type = 1;
string domain = 2;
repeated bytes ip = 3;
// ProxiedDomain indicates the mapped domain has the same IP address on this
// domain. V2Ray will use this domain for IP queries.
string proxied_domain = 4;
}
message Config {
// Nameservers used by this DNS. Only traditional UDP servers are support at
// the moment. A special value 'localhost' as a domain address can be set to
// use DNS on local system.
repeated v2ray.core.common.net.Endpoint NameServers = 1 [deprecated = true];
// NameServer list used by this DNS client.
repeated NameServer name_server = 5;
// Static hosts. Domain to IP.
// Deprecated. Use static_hosts.
map<string, v2ray.core.common.net.IPOrDomain> Hosts = 2 [deprecated = true];
// Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
// (IPv6).
bytes client_ip = 3;
// Static domain-ip mapping in DNS server.
repeated HostMapping static_hosts = 4;
// Global fakedns object.
v2ray.core.app.dns.fakedns.FakeDnsPoolMulti fake_dns = 16;
// Tag is the inbound tag of DNS client.
string tag = 6;
reserved 7;
// Domain matcher to use
string domain_matcher = 15;
// DisableCache disables DNS cache
// Deprecated. Use cache_strategy.
bool disableCache = 8 [deprecated = true];
// Deprecated. Use fallback_strategy.
bool disableFallback = 10 [deprecated = true];
// Deprecated. Use fallback_strategy.
bool disableFallbackIfMatch = 11 [deprecated = true];
// Default query strategy (IPv4, IPv6, or both) for each name server.
QueryStrategy query_strategy = 9;
// Default cache strategy for each name server.
CacheStrategy cache_strategy = 12;
// Default fallback strategy for each name server.
FallbackStrategy fallback_strategy = 13;
}
message SimplifiedConfig {
option (v2ray.core.common.protoext.message_opt).type = "service";
option (v2ray.core.common.protoext.message_opt).short_name = "dns";
// Nameservers used by this DNS. Only traditional UDP servers are support at
// the moment. A special value 'localhost' as a domain address can be set to
// use DNS on local system.
reserved 1;
// NameServer list used by this DNS client.
repeated SimplifiedNameServer name_server = 5;
// Static hosts. Domain to IP.
// Deprecated. Use static_hosts.
reserved 2;
// Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
// (IPv6).
string client_ip = 3;
// Static domain-ip mapping in DNS server.
repeated SimplifiedHostMapping static_hosts = 4;
// Global fakedns object.
v2ray.core.app.dns.fakedns.FakeDnsPoolMulti fake_dns = 16;
// Tag is the inbound tag of DNS client.
string tag = 6;
reserved 7;
// Domain matcher to use
string domain_matcher = 15;
// DisableCache disables DNS cache
// Deprecated. Use cache_strategy.
bool disableCache = 8 [deprecated = true];
// Deprecated. Use fallback_strategy.
bool disableFallback = 10 [deprecated = true];
// Deprecated. Use fallback_strategy.
bool disableFallbackIfMatch = 11 [deprecated = true];
// Default query strategy (IPv4, IPv6, or both) for each name server.
QueryStrategy query_strategy = 9;
// Default cache strategy for each name server.
CacheStrategy cache_strategy = 12;
// Default fallback strategy for each name server.
FallbackStrategy fallback_strategy = 13;
}
message SimplifiedHostMapping {
DomainMatchingType type = 1;
string domain = 2;
repeated string ip = 3;
// ProxiedDomain indicates the mapped domain has the same IP address on this
// domain. V2Ray will use this domain for IP queries.
string proxied_domain = 4;
}
message SimplifiedNameServer {
v2ray.core.common.net.Endpoint address = 1;
string client_ip = 5;
string tag = 7;
message PriorityDomain {
DomainMatchingType type = 1;
string domain = 2;
}
message OriginalRule {
string rule = 1;
uint32 size = 2;
}
repeated PriorityDomain prioritized_domain = 2;
repeated v2ray.core.app.router.routercommon.GeoIP geoip = 3;
repeated OriginalRule original_rules = 4;
v2ray.core.app.dns.fakedns.FakeDnsPoolMulti fake_dns = 11;
// Deprecated. Use fallback_strategy.
bool skipFallback = 6 [deprecated = true];
optional QueryStrategy query_strategy = 8;
optional CacheStrategy cache_strategy = 9;
optional FallbackStrategy fallback_strategy = 10;
repeated v2ray.core.app.router.routercommon.GeoSite geo_domain = 68001;
}
================================================
FILE: app/dns/dns.go
================================================
//go:build !confonly
// +build !confonly
// Package dns is an implementation of core.DNS feature.
package dns
//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen
import (
"context"
"fmt"
"strings"
"sync"
core "github.com/v2fly/v2ray-core/v5"
"github.com/v2fly/v2ray-core/v5/app/dns/fakedns"
"github.com/v2fly/v2ray-core/v5/app/router"
"github.com/v2fly/v2ray-core/v5/app/router/routercommon"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/errors"
"github.com/v2fly/v2ray-core/v5/common/net"
"github.com/v2fly/v2ray-core/v5/common/platform"
"github.com/v2fly/v2ray-core/v5/common/session"
"github.com/v2fly/v2ray-core/v5/common/strmatcher"
"github.com/v2fly/v2ray-core/v5/features"
"github.com/v2fly/v2ray-core/v5/features/dns"
"github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon"
"github.com/v2fly/v2ray-core/v5/infra/conf/geodata"
)
// DNS is a DNS rely server.
type DNS struct {
sync.Mutex
hosts *StaticHosts
clients []*Client
ctx context.Context
clientTags map[string]bool
fakeDNSEngine *FakeDNSEngine
domainMatcher strmatcher.IndexMatcher
matcherInfos []DomainMatcherInfo
}
// DomainMatcherInfo contains information attached to index returned by Server.domainMatcher
type DomainMatcherInfo struct {
clientIdx uint16
domainRuleIdx uint16
}
// New creates a new DNS server with given configuration.
func New(ctx context.Context, config *Config) (*DNS, error) {
// Create static hosts
hosts, err := NewStaticHosts(config.StaticHosts, config.Hosts)
if err != nil {
return nil, newError("failed to create hosts").Base(err)
}
// Create name servers from legacy configs
clients := []*Client{}
for _, endpoint := range config.NameServers {
features.PrintDeprecatedFeatureWarning("simple DNS server")
client, err := NewClient(ctx, &NameServer{Address: endpoint}, config)
if err != nil {
return nil, newError("failed to create client").Base(err)
}
clients = append(clients, client)
}
// Create name servers
nsClientMap := map[int]int{}
for nsIdx, ns := range config.NameServer {
client, err := NewClient(ctx, ns, config)
if err != nil {
return nil, newError("failed to create client").Base(err)
}
nsClientMap[nsIdx] = len(clients)
clients = append(clients, client)
}
// If there is no DNS client in config, add a `localhost` DNS client
if len(clients) == 0 {
clients = append(clients, NewLocalDNSClient())
}
s := &DNS{
hosts: hosts,
clients: clients,
ctx: ctx,
}
// Establish members related to global DNS state
s.clientTags = make(map[string]bool)
for _, client := range clients {
s.clientTags[client.tag] = true
}
if err := establishDomainRules(s, config, nsClientMap); err != nil {
return nil, err
}
if err := establishExpectedIPs(s, config, nsClientMap); err != nil {
return nil, err
}
if err := establishFakeDNS(s, config, nsClientMap); err != nil {
return nil, err
}
return s, nil
}
func establishDomainRules(s *DNS, config *Config, nsClientMap map[int]int) error {
domainRuleCount := 0
for _, ns := range config.NameServer {
domainRuleCount += len(ns.PrioritizedDomain)
}
// MatcherInfos is ensured to cover the maximum index domainMatcher could return, where matcher's index starts from 1
matcherInfos := make([]DomainMatcherInfo, domainRuleCount+1)
var domainMatcher strmatcher.IndexMatcher
switch config.DomainMatcher {
case "mph", "hybrid":
newError("using mph domain matcher").AtDebug().WriteToLog()
domainMatcher = strmatcher.NewMphIndexMatcher()
case "linear":
fallthrough
default:
newError("using default domain matcher").AtDebug().WriteToLog()
domainMatcher = strmatcher.NewLinearIndexMatcher()
}
for nsIdx, ns := range config.NameServer {
clientIdx := nsClientMap[nsIdx]
var rules []string
ruleCurr := 0
ruleIter := 0
for _, domain := range ns.PrioritizedDomain {
domainRule, err := toStrMatcher(domain.Type, domain.Domain)
if err != nil {
return newError("failed to create prioritized domain").Base(err).AtWarning()
}
originalRuleIdx := ruleCurr
if ruleCurr < len(ns.OriginalRules) {
rule := ns.OriginalRules[ruleCurr]
if ruleCurr >= len(rules) {
rules = append(rules, rule.Rule)
}
ruleIter++
if ruleIter >= int(rule.Size) {
ruleIter = 0
ruleCurr++
}
} else { // No original rule, generate one according to current domain matcher (majorly for compatibility with tests)
rules = append(rules, domainRule.String())
ruleCurr++
}
midx := domainMatcher.Add(domainRule)
matcherInfos[midx] = DomainMatcherInfo{
clientIdx: uint16(clientIdx),
domainRuleIdx: uint16(originalRuleIdx),
}
if err != nil {
return newError("failed to create prioritized domain").Base(err).AtWarning()
}
}
s.clients[clientIdx].domains = rules
}
if err := domainMatcher.Build(); err != nil {
return err
}
s.domainMatcher = domainMatcher
s.matcherInfos = matcherInfos
return nil
}
func establishExpectedIPs(s *DNS, config *Config, nsClientMap map[int]int) error {
geoipContainer := router.GeoIPMatcherContainer{}
for nsIdx, ns := range config.NameServer {
clientIdx := nsClientMap[nsIdx]
var matchers []*router.GeoIPMatcher
for _, geoip := range ns.Geoip {
matcher, err := geoipContainer.Add(geoip)
if err != nil {
return newError("failed to create ip matcher").Base(err).AtWarning()
}
matchers = append(matchers, matcher)
}
s.clients[clientIdx].expectIPs = matchers
}
return nil
}
func establishFakeDNS(s *DNS, config *Config, nsClientMap map[int]int) error {
fakeHolders := &fakedns.HolderMulti{}
fakeDefault := (*fakedns.HolderMulti)(nil)
if config.FakeDns != nil {
defaultEngine, err := fakeHolders.AddPoolMulti(config.FakeDns)
if err != nil {
return newError("fail to create fake dns").Base(err).AtWarning()
}
fakeDefault = defaultEngine
}
for nsIdx, ns := range config.NameServer {
clientIdx := nsClientMap[nsIdx]
if ns.FakeDns == nil {
continue
}
engine, err := fakeHolders.AddPoolMulti(ns.FakeDns)
if err != nil {
return newError("fail to create fake dns").Base(err).AtWarning()
}
s.clients[clientIdx].fakeDNS = NewFakeDNSServer(engine)
s.clients[clientIdx].queryStrategy.FakeEnable = true
}
// Do not create FakeDNSEngine feature if no FakeDNS server is configured
if fakeHolders.IsEmpty() {
return nil
}
// Add FakeDNSEngine feature when DNS feature is added for the first time
s.fakeDNSEngine = &FakeDNSEngine{dns: s, fakeHolders: fakeHolders, fakeDefault: fakeDefault}
return core.RequireFeatures(s.ctx, func(client dns.Client) error {
v := core.MustFromContext(s.ctx)
if v.GetFeature(dns.FakeDNSEngineType()) != nil {
return nil
}
if client, ok := client.(dns.ClientWithFakeDNS); ok {
return v.AddFeature(client.AsFakeDNSEngine())
}
return nil
})
}
// Type implements common.HasType.
func (*DNS) Type() interface{} {
return dns.ClientType()
}
// Start implements common.Runnable.
func (s *DNS) Start() error {
return nil
}
// Close implements common.Closable.
func (s *DNS) Close() error {
return nil
}
// IsOwnLink implements proxy.dns.ownLinkVerifier
func (s *DNS) IsOwnLink(ctx context.Context) bool {
inbound := session.InboundFromContext(ctx)
return inbound != nil && s.clientTags[inbound.Tag]
}
// AsFakeDNSClient implements dns.ClientWithFakeDNS.
func (s *DNS) AsFakeDNSClient() dns.Client {
return &FakeDNSClient{DNS: s}
}
// AsFakeDNSEngine implements dns.ClientWithFakeDNS.
func (s *DNS) AsFakeDNSEngine() dns.FakeDNSEngine {
return s.fakeDNSEngine
}
// LookupIP implements dns.Client.
func (s *DNS) LookupIP(domain string) ([]net.IP, error) {
return s.lookupIPInternal(domain, dns.IPOption{IPv4Enable: true, IPv6Enable: true, FakeEnable: false})
}
// LookupIPv4 implements dns.IPv4Lookup.
func (s *DNS) LookupIPv4(domain string) ([]net.IP, error) {
return s.lookupIPInternal(domain, dns.IPOption{IPv4Enable: true, FakeEnable: false})
}
// LookupIPv6 implements dns.IPv6Lookup.
func (s *DNS) LookupIPv6(domain string) ([]net.IP, error) {
return s.lookupIPInternal(domain, dns.IPOption{IPv6Enable: true, FakeEnable: false})
}
func (s *DNS) lookupIPInternal(domain string, option dns.IPOption) ([]net.IP, error) {
if domain == "" {
return nil, newError("empty domain name")
}
// Normalize the FQDN form query
domain = strings.TrimSuffix(domain, ".")
// Static host lookup
switch addrs := s.hosts.Lookup(domain, option); {
case addrs == nil: // Domain not recorded in static host
break
case len(addrs) == 0: // Domain recorded, but no valid IP returned (e.g. IPv4 address with only IPv6 enabled)
return nil, dns.ErrEmptyResponse
case len(addrs) == 1 && addrs[0].Family().IsDomain(): // Domain replacement
newError("domain replaced: ", domain, " -> ", addrs[0].Domain()).WriteToLog()
domain = addrs[0].Domain()
default: // Successfully found ip records in static host
newError("returning ", len(addrs), " IP(s) for domain ", domain, " -> ", addrs).WriteToLog()
return toNetIP(addrs)
}
// Name servers lookup
errs := []error{}
for _, client := range s.sortClients(domain, option) {
ips, err := client.QueryIP(s.ctx, domain, option)
if len(ips) > 0 {
return ips, nil
}
if err != nil {
errs = append(errs, err)
}
if err != dns.ErrEmptyResponse { // ErrEmptyResponse is not seen as failure, so no failed log
newError("failed to lookup ip for domain ", domain, " at server ", client.Name()).Base(err).WriteToLog()
}
if err != context.Canceled && err != context.DeadlineExceeded && err != errExpectedIPNonMatch {
return nil, err // Only continue lookup for certain errors
}
}
if len(errs) == 0 {
return nil, dns.ErrEmptyResponse
}
return nil, newError("returning nil for domain ", domain).Base(errors.Combine(errs...))
}
func (s *DNS) sortClients(domain string, option dns.IPOption) []*Client {
clients := make([]*Client, 0, len(s.clients))
clientUsed := make([]bool, len(s.clients))
clientIdxs := make([]int, 0, len(s.clients))
domainRules := []string{}
// Priority domain matching
for _, match := range s.domainMatcher.Match(domain) {
info := s.matcherInfos[match]
client := s.clients[info.clientIdx]
domainRule := client.domains[info.domainRuleIdx]
domainRules = append(domainRules, fmt.Sprintf("%s(DNS idx:%d)", domainRule, info.clientIdx))
switch {
case clientUsed[info.clientIdx]:
continue
case !option.FakeEnable && isFakeDNS(client.server):
continue
}
clientUsed[info.clientIdx] = true
clients = append(clients, client)
clientIdxs = append(clientIdxs, int(info.clientIdx))
}
// Default round-robin query
hasDomainMatch := len(clients) > 0
for idx, client := range s.clients {
switch {
case clientUsed[idx]:
continue
case !option.FakeEnable && isFakeDNS(client.server):
continue
case client.fallbackStrategy == FallbackStrategy_Disabled:
continue
case client.fallbackStrategy == FallbackStrategy_DisabledIfAnyMatch && hasDomainMatch:
continue
}
clientUsed[idx] = true
clients = append(clients, client)
clientIdxs = append(clientIdxs, idx)
}
if len(domainRules) > 0 {
newError("domain ", domain, " matches following rules: ", domainRules).AtDebug().WriteToLog()
}
if len(clientIdxs) > 0 {
newError("domain ", domain, " will use DNS in order: ", s.formatClientNames(clientIdxs, option), " ", toReqTypes(option)).AtDebug().WriteToLog()
}
return clients
}
func (s *DNS) formatClientNames(clientIdxs []int, option dns.IPOption) []string {
clientNames := make([]string, 0, len(clientIdxs))
counter := make(map[string]uint, len(clientIdxs))
for _, clientIdx := range clientIdxs {
client := s.clients[clientIdx]
var name string
if option.With(client.queryStrategy).FakeEnable {
name = fmt.Sprintf("%s(DNS idx:%d)", client.fakeDNS.Name(), clientIdx)
} else {
name = client.Name()
}
counter[name]++
clientNames = append(clientNames, name)
}
for idx, clientIdx := range clientIdxs {
name := clientNames[idx]
if counter[name] > 1 {
clientNames[idx] = fmt.Sprintf("%s(DNS idx:%d)", name, clientIdx)
}
}
return clientNames
}
var matcherTypeMap = map[routercommon.Domain_Type]DomainMatchingType{
routercommon.Domain_Plain: DomainMatchingType_Keyword,
routercommon.Domain_Regex: DomainMatchingType_Regex,
routercommon.Domain_RootDomain: DomainMatchingType_Subdomain,
routercommon.Domain_Full: DomainMatchingType_Full,
}
func init() {
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
return New(ctx, config.(*Config))
}))
common.Must(common.RegisterConfig((*SimplifiedConfig)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
ctx = cfgcommon.NewConfigureLoadingContext(ctx)
geoloadername := platform.NewEnvFlag("v2ray.conf.geoloader").GetValue(func() string {
return "standard"
})
if loader, err := geodata.GetGeoDataLoader(geoloadername); err == nil {
cfgcommon.SetGeoDataLoader(ctx, loader)
} else {
return nil, newError("unable to create geo data loader ").Base(err)
}
cfgEnv := cfgcommon.GetConfigureLoadingEnvironment(ctx)
geoLoader := cfgEnv.GetGeoLoader()
simplifiedConfig := config.(*SimplifiedConfig)
for _, v := range simplifiedConfig.NameServer {
for _, geo := range v.Geoip {
if geo.Code != "" {
filepath := "geoip.dat"
if geo.FilePath != "" {
filepath = geo.FilePath
} else {
geo.CountryCode = geo.Code
}
var err error
geo.Cidr, err = geoLoader.LoadIP(filepath, geo.Code)
if err != nil {
return nil, newError("unable to load geoip").Base(err)
}
}
}
for _, geo := range v.GeoDomain {
if geo.Code != "" {
filepath := "geosite.dat"
if geo.FilePath != "" {
filepath = geo.FilePath
}
var err error
geo.Domain, err = geoLoader.LoadGeoSiteWithAttr(filepath, geo.Code)
if err != nil {
return nil, newError("unable to load geodomain").Base(err)
}
}
for _, domain := range geo.Domain {
v.PrioritizedDomain = append(v.PrioritizedDomain, &SimplifiedNameServer_PriorityDomain{
Type: matcherTypeMap[domain.Type],
Domain: domain.Value,
})
}
}
}
var nameservers []*NameServer
for _, v := range simplifiedConfig.NameServer {
nameserver := &NameServer{
Address: v.Address,
ClientIp: net.ParseIP(v.ClientIp),
Tag: v.Tag,
QueryStrategy: v.QueryStrategy,
CacheStrategy: v.CacheStrategy,
FallbackStrategy: v.FallbackStrategy,
SkipFallback: v.SkipFallback,
Geoip: v.Geoip,
}
for _, prioritizedDomain := range v.PrioritizedDomain {
nameserver.PrioritizedDomain = append(nameserver.PrioritizedDomain, &NameServer_PriorityDomain{
Type: prioritizedDomain.Type,
Domain: prioritizedDomain.Domain,
})
}
nameservers = append(nameservers, nameserver)
}
var statichosts []*HostMapping
for _, v := range simplifiedConfig.StaticHosts {
statichost := &HostMapping{
Type: v.Type,
Domain: v.Domain,
ProxiedDomain: v.ProxiedDomain,
}
for _, ip := range v.Ip {
statichost.Ip = append(statichost.Ip, net.ParseIP(ip))
}
statichosts = append(statichosts, statichost)
}
fullConfig := &Config{
StaticHosts: statichosts,
NameServer: nameservers,
ClientIp: net.ParseIP(simplifiedConfig.ClientIp),
Tag: simplifiedConfig.Tag,
DomainMatcher: simplifiedConfig.DomainMatcher,
QueryStrategy: simplifiedConfig.QueryStrategy,
CacheStrategy: simplifiedConfig.CacheStrategy,
FallbackStrategy: simplifiedConfig.FallbackStrategy,
// Deprecated flags
DisableCache: simplifiedConfig.DisableCache,
DisableFallback: simplifiedConfig.DisableFallback,
DisableFallbackIfMatch: simplifiedConfig.DisableFallbackIfMatch,
}
return common.CreateObject(ctx, fullConfig)
}))
}
================================================
FILE: app/dns/dns_test.go
================================================
package dns_test
import (
"testing"
"time"
"github.com/google/go-cmp/cmp"
"github.com/miekg/dns"
"google.golang.org/protobuf/types/known/anypb"
core "github.com/v2fly/v2ray-core/v5"
"github.com/v2fly/v2ray-core/v5/app/dispatcher"
. "github.com/v2fly/v2ray-core/v5/app/dns"
"github.com/v2fly/v2ray-core/v5/app/policy"
"github.com/v2fly/v2ray-core/v5/app/proxyman"
_ "github.com/v2fly/v2ray-core/v5/app/proxyman/outbound"
"github.com/v2fly/v2ray-core/v5/app/router/routercommon"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/net"
"github.com/v2fly/v2ray-core/v5/common/serial"
"github.com/v2fly/v2ray-core/v5/common/strmatcher"
feature_dns "github.com/v2fly/v2ray-core/v5/features/dns"
"github.com/v2fly/v2ray-core/v5/proxy/freedom"
"github.com/v2fly/v2ray-core/v5/testing/servers/udp"
)
type staticHandler struct{}
func (*staticHandler) ServeDNS(w dns.ResponseWriter, r *dns.Msg) {
ans := new(dns.Msg)
ans.Id = r.Id
var clientIP net.IP
opt := r.IsEdns0()
if opt != nil {
for _, o := range opt.Option {
if o.Option() == dns.EDNS0SUBNET {
subnet := o.(*dns.EDNS0_SUBNET)
clientIP = subnet.Address
}
}
}
for _, q := range r.Question {
switch {
case q.Name == "google.com." && q.Qtype == dns.TypeA:
if clientIP == nil {
rr, _ := dns.NewRR("google.com. IN A 8.8.8.8")
ans.Answer = append(ans.Answer, rr)
} else {
rr, _ := dns.NewRR("google.com. IN A 8.8.4.4")
ans.Answer = append(ans.Answer, rr)
}
case q.Name == "api.google.com." && q.Qtype == dns.TypeA:
rr, _ := dns.NewRR("api.google.com. IN A 8.8.7.7")
ans.Answer = append(ans.Answer, rr)
case q.Name == "v2.api.google.com." && q.Qtype == dns.TypeA:
rr, _ := dns.NewRR("v2.api.google.com. IN A 8.8.7.8")
ans.Answer = append(ans.Answer, rr)
case q.Name == "facebook.com." && q.Qtype == dns.TypeA:
rr, _ := dns.NewRR("facebook.com. IN A 9.9.9.9")
ans.Answer = append(ans.Answer, rr)
case q.Name == "ipv6.google.com." && q.Qtype == dns.TypeA:
rr, err := dns.NewRR("ipv6.google.com. IN A 8.8.8.7")
common.Must(err)
ans.Answer = append(ans.Answer, rr)
case q.Name == "ipv6.google.com." && q.Qtype == dns.TypeAAAA:
rr, err := dns.NewRR("ipv6.google.com. IN AAAA 2001:4860:4860::8888")
common.Must(err)
ans.Answer = append(ans.Answer, rr)
case q.Name == "notexist.google.com." && q.Qtype == dns.TypeAAAA:
ans.MsgHdr.Rcode = dns.RcodeNameError
case q.Name == "hostname." && q.Qtype == dns.TypeA:
rr, _ := dns.NewRR("hostname. IN A 127.0.0.1")
ans.Answer = append(ans.Answer, rr)
case q.Name == "hostname.local." && q.Qtype == dns.TypeA:
rr, _ := dns.NewRR("hostname.local. IN A 127.0.0.1")
ans.Answer = append(ans.Answer, rr)
case q.Name == "hostname.localdomain." && q.Qtype == dns.TypeA:
rr, _ := dns.NewRR("hostname.localdomain. IN A 127.0.0.1")
ans.Answer = append(ans.Answer, rr)
case q.Name == "localhost." && q.Qtype == dns.TypeA:
rr, _ := dns.NewRR("localhost. IN A 127.0.0.2")
ans.Answer = append(ans.Answer, rr)
case q.Name == "localhost-a." && q.Qtype == dns.TypeA:
rr, _ := dns.NewRR("localhost-a. IN A 127.0.0.3")
ans.Answer = append(ans.Answer, rr)
case q.Name == "localhost-b." && q.Qtype == dns.TypeA:
rr, _ := dns.NewRR("localhost-b. IN A 127.0.0.4")
ans.Answer = append(ans.Answer, rr)
case q.Name == "Mijia\\ Cloud." && q.Qtype == dns.TypeA:
rr, _ := dns.NewRR("Mijia\\ Cloud. IN A 127.0.0.1")
ans.Answer = append(ans.Answer, rr)
case q.Name == "xn--vi8h.ws." /* 🍕.ws */ && q.Qtype == dns.TypeA:
rr, err := dns.NewRR("xn--vi8h.ws. IN A 208.100.42.200")
common.Must(err)
ans.Answer = append(ans.Answer, rr)
case q.Name == "xn--l8jaaa.com." /* ああああ.com */ && q.Qtype == dns.TypeA:
rr, err := dns.NewRR("xn--l8jaaa.com. IN AAAA a:a:a:a::aaaa")
common.Must(err)
ans.Answer = append(ans.Answer, rr)
}
}
w.WriteMsg(ans)
}
func TestUDPServerSubnet(t *testing.T) {
port := udp.PickPort()
dnsServer := dns.Server{
Addr: "127.0.0.1:" + port.String(),
Net: "udp",
Handler: &staticHandler{},
UDPSize: 1200,
}
go dnsServer.ListenAndServe()
time.Sleep(time.Second)
config := &core.Config{
App: []*anypb.Any{
serial.ToTypedMessage(&Config{
NameServers: []*net.Endpoint{
{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: uint32(port),
},
},
ClientIp: []byte{7, 8, 9, 10},
}),
serial.ToTypedMessage(&dispatcher.Config{}),
serial.ToTypedMessage(&proxyman.OutboundConfig{}),
serial.ToTypedMessage(&policy.Config{}),
},
Outbound: []*core.OutboundHandlerConfig{
{
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
},
},
}
v, err := core.New(config)
common.Must(err)
client := v.GetFeature(feature_dns.ClientType()).(feature_dns.Client)
ips, err := client.LookupIP("google.com")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{8, 8, 4, 4}}); r != "" {
t.Fatal(r)
}
}
func TestUDPServer(t *testing.T) {
port := udp.PickPort()
dnsServer := dns.Server{
Addr: "127.0.0.1:" + port.String(),
Net: "udp",
Handler: &staticHandler{},
UDPSize: 1200,
}
go dnsServer.ListenAndServe()
time.Sleep(time.Second)
config := &core.Config{
App: []*anypb.Any{
serial.ToTypedMessage(&Config{
NameServers: []*net.Endpoint{
{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: uint32(port),
},
},
}),
serial.ToTypedMessage(&dispatcher.Config{}),
serial.ToTypedMessage(&proxyman.OutboundConfig{}),
serial.ToTypedMessage(&policy.Config{}),
},
Outbound: []*core.OutboundHandlerConfig{
{
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
},
},
}
v, err := core.New(config)
common.Must(err)
client := v.GetFeature(feature_dns.ClientType()).(feature_dns.Client)
{
ips, err := client.LookupIP("google.com")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{8, 8, 8, 8}}); r != "" {
t.Fatal(r)
}
}
{
ips, err := client.LookupIP("facebook.com")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{9, 9, 9, 9}}); r != "" {
t.Fatal(r)
}
}
{
_, err := client.LookupIP("notexist.google.com")
if err == nil {
t.Fatal("nil error")
}
if r := feature_dns.RCodeFromError(err); r != uint16(dns.RcodeNameError) {
t.Fatal("expected NameError, but got ", r)
}
}
{
clientv6 := client.(feature_dns.IPv6Lookup)
ips, err := clientv6.LookupIPv6("ipv4only.google.com")
if err != feature_dns.ErrEmptyResponse {
t.Fatal("error: ", err)
}
if len(ips) != 0 {
t.Fatal("ips: ", ips)
}
}
{
ips, err := client.LookupIP(common.Must2(strmatcher.ToDomain("🍕.ws")).(string))
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{208, 100, 42, 200}}); r != "" {
t.Fatal(r)
}
}
{
ips, err := client.LookupIP(common.Must2(strmatcher.ToDomain("ああああ.com")).(string))
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{0, 0xa, 0, 0xa, 0, 0xa, 0, 0xa, 0, 0, 0, 0, 0, 0, 0xaa, 0xaa}}); r != "" {
t.Fatal(r)
}
}
dnsServer.Shutdown()
{
ips, err := client.LookupIP("google.com")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{8, 8, 8, 8}}); r != "" {
t.Fatal(r)
}
}
}
func TestPrioritizedDomain(t *testing.T) {
port := udp.PickPort()
dnsServer := dns.Server{
Addr: "127.0.0.1:" + port.String(),
Net: "udp",
Handler: &staticHandler{},
UDPSize: 1200,
}
go dnsServer.ListenAndServe()
time.Sleep(time.Second)
config := &core.Config{
App: []*anypb.Any{
serial.ToTypedMessage(&Config{
NameServers: []*net.Endpoint{
{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: 9999, /* unreachable */
},
},
NameServer: []*NameServer{
{
Address: &net.Endpoint{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: uint32(port),
},
PrioritizedDomain: []*NameServer_PriorityDomain{
{
Type: DomainMatchingType_Full,
Domain: "google.com",
},
},
},
},
}),
serial.ToTypedMessage(&dispatcher.Config{}),
serial.ToTypedMessage(&proxyman.OutboundConfig{}),
serial.ToTypedMessage(&policy.Config{}),
},
Outbound: []*core.OutboundHandlerConfig{
{
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
},
},
}
v, err := core.New(config)
common.Must(err)
client := v.GetFeature(feature_dns.ClientType()).(feature_dns.Client)
startTime := time.Now()
{
ips, err := client.LookupIP("google.com")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{8, 8, 8, 8}}); r != "" {
t.Fatal(r)
}
}
endTime := time.Now()
if startTime.After(endTime.Add(time.Second * 2)) {
t.Error("DNS query doesn't finish in 2 seconds.")
}
}
func TestUDPServerIPv6(t *testing.T) {
port := udp.PickPort()
dnsServer := dns.Server{
Addr: "127.0.0.1:" + port.String(),
Net: "udp",
Handler: &staticHandler{},
UDPSize: 1200,
}
go dnsServer.ListenAndServe()
time.Sleep(time.Second)
config := &core.Config{
App: []*anypb.Any{
serial.ToTypedMessage(&Config{
NameServers: []*net.Endpoint{
{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: uint32(port),
},
},
}),
serial.ToTypedMessage(&dispatcher.Config{}),
serial.ToTypedMessage(&proxyman.OutboundConfig{}),
serial.ToTypedMessage(&policy.Config{}),
},
Outbound: []*core.OutboundHandlerConfig{
{
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
},
},
}
v, err := core.New(config)
common.Must(err)
client := v.GetFeature(feature_dns.ClientType()).(feature_dns.Client)
client6 := client.(feature_dns.IPv6Lookup)
{
ips, err := client6.LookupIPv6("ipv6.google.com")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{32, 1, 72, 96, 72, 96, 0, 0, 0, 0, 0, 0, 0, 0, 136, 136}}); r != "" {
t.Fatal(r)
}
}
}
func TestStaticHostDomain(t *testing.T) {
port := udp.PickPort()
dnsServer := dns.Server{
Addr: "127.0.0.1:" + port.String(),
Net: "udp",
Handler: &staticHandler{},
UDPSize: 1200,
}
go dnsServer.ListenAndServe()
time.Sleep(time.Second)
config := &core.Config{
App: []*anypb.Any{
serial.ToTypedMessage(&Config{
NameServers: []*net.Endpoint{
{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: uint32(port),
},
},
StaticHosts: []*HostMapping{
{
Type: DomainMatchingType_Full,
Domain: "example.com",
ProxiedDomain: "google.com",
},
},
}),
serial.ToTypedMessage(&dispatcher.Config{}),
serial.ToTypedMessage(&proxyman.OutboundConfig{}),
serial.ToTypedMessage(&policy.Config{}),
},
Outbound: []*core.OutboundHandlerConfig{
{
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
},
},
}
v, err := core.New(config)
common.Must(err)
client := v.GetFeature(feature_dns.ClientType()).(feature_dns.Client)
{
ips, err := client.LookupIP("example.com")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{8, 8, 8, 8}}); r != "" {
t.Fatal(r)
}
}
dnsServer.Shutdown()
}
func TestIPMatch(t *testing.T) {
port := udp.PickPort()
dnsServer := dns.Server{
Addr: "127.0.0.1:" + port.String(),
Net: "udp",
Handler: &staticHandler{},
UDPSize: 1200,
}
go dnsServer.ListenAndServe()
time.Sleep(time.Second)
config := &core.Config{
App: []*anypb.Any{
serial.ToTypedMessage(&Config{
NameServer: []*NameServer{
// private dns, not match
{
Address: &net.Endpoint{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: uint32(port),
},
Geoip: []*routercommon.GeoIP{
{
CountryCode: "local",
Cidr: []*routercommon.CIDR{
{
// inner ip, will not match
Ip: []byte{192, 168, 11, 1},
Prefix: 32,
},
},
},
},
},
// second dns, match ip
{
Address: &net.Endpoint{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: uint32(port),
},
Geoip: []*routercommon.GeoIP{
{
CountryCode: "test",
Cidr: []*routercommon.CIDR{
{
Ip: []byte{8, 8, 8, 8},
Prefix: 32,
},
},
},
{
CountryCode: "test",
Cidr: []*routercommon.CIDR{
{
Ip: []byte{8, 8, 8, 4},
Prefix: 32,
},
},
},
},
},
},
}),
serial.ToTypedMessage(&dispatcher.Config{}),
serial.ToTypedMessage(&proxyman.OutboundConfig{}),
serial.ToTypedMessage(&policy.Config{}),
},
Outbound: []*core.OutboundHandlerConfig{
{
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
},
},
}
v, err := core.New(config)
common.Must(err)
client := v.GetFeature(feature_dns.ClientType()).(feature_dns.Client)
startTime := time.Now()
{
ips, err := client.LookupIP("google.com")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{8, 8, 8, 8}}); r != "" {
t.Fatal(r)
}
}
endTime := time.Now()
if startTime.After(endTime.Add(time.Second * 2)) {
t.Error("DNS query doesn't finish in 2 seconds.")
}
}
func TestLocalDomain(t *testing.T) {
port := udp.PickPort()
dnsServer := dns.Server{
Addr: "127.0.0.1:" + port.String(),
Net: "udp",
Handler: &staticHandler{},
UDPSize: 1200,
}
go dnsServer.ListenAndServe()
time.Sleep(time.Second)
config := &core.Config{
App: []*anypb.Any{
serial.ToTypedMessage(&Config{
NameServers: []*net.Endpoint{
{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: 9999, /* unreachable */
},
},
NameServer: []*NameServer{
{
Address: &net.Endpoint{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: uint32(port),
},
PrioritizedDomain: []*NameServer_PriorityDomain{
// Equivalent of dotless:localhost
{Type: DomainMatchingType_Regex, Domain: "^[^.]*localhost[^.]*$"},
},
Geoip: []*routercommon.GeoIP{
{ // Will match localhost, localhost-a and localhost-b,
CountryCode: "local",
Cidr: []*routercommon.CIDR{
{Ip: []byte{127, 0, 0, 2}, Prefix: 32},
{Ip: []byte{127, 0, 0, 3}, Prefix: 32},
{Ip: []byte{127, 0, 0, 4}, Prefix: 32},
},
},
},
},
{
Address: &net.Endpoint{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: uint32(port),
},
PrioritizedDomain: []*NameServer_PriorityDomain{
// Equivalent of dotless: and domain:local
{Type: DomainMatchingType_Regex, Domain: "^[^.]*$"},
{Type: DomainMatchingType_Subdomain, Domain: "local"},
{Type: DomainMatchingType_Subdomain, Domain: "localdomain"},
},
},
},
StaticHosts: []*HostMapping{
{
Type: DomainMatchingType_Full,
Domain: "hostnamestatic",
Ip: [][]byte{{127, 0, 0, 53}},
},
{
Type: DomainMatchingType_Full,
Domain: "hostnamealias",
ProxiedDomain: "hostname.localdomain",
},
},
}),
serial.ToTypedMessage(&dispatcher.Config{}),
serial.ToTypedMessage(&proxyman.OutboundConfig{}),
serial.ToTypedMessage(&policy.Config{}),
},
Outbound: []*core.OutboundHandlerConfig{
{
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
},
},
}
v, err := core.New(config)
common.Must(err)
client := v.GetFeature(feature_dns.ClientType()).(feature_dns.Client)
startTime := time.Now()
{ // Will match dotless:
ips, err := client.LookupIP("hostname")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 1}}); r != "" {
t.Fatal(r)
}
}
{ // Will match domain:local
ips, err := client.LookupIP("hostname.local")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 1}}); r != "" {
t.Fatal(r)
}
}
{ // Will match static ip
ips, err := client.LookupIP("hostnamestatic")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 53}}); r != "" {
t.Fatal(r)
}
}
{ // Will match domain replacing
ips, err := client.LookupIP("hostnamealias")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 1}}); r != "" {
t.Fatal(r)
}
}
{ // Will match dotless:localhost, but not expectIPs: 127.0.0.2, 127.0.0.3, then matches at dotless:
ips, err := client.LookupIP("localhost")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 2}}); r != "" {
t.Fatal(r)
}
}
{ // Will match dotless:localhost, and expectIPs: 127.0.0.2, 127.0.0.3
ips, err := client.LookupIP("localhost-a")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 3}}); r != "" {
t.Fatal(r)
}
}
{ // Will match dotless:localhost, and expectIPs: 127.0.0.2, 127.0.0.3
ips, err := client.LookupIP("localhost-b")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 4}}); r != "" {
t.Fatal(r)
}
}
{ // Will match dotless:
ips, err := client.LookupIP("Mijia Cloud")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 1}}); r != "" {
t.Fatal(r)
}
}
endTime := time.Now()
if startTime.After(endTime.Add(time.Second * 2)) {
t.Error("DNS query doesn't finish in 2 seconds.")
}
}
func TestMultiMatchPrioritizedDomain(t *testing.T) {
port := udp.PickPort()
dnsServer := dns.Server{
Addr: "127.0.0.1:" + port.String(),
Net: "udp",
Handler: &staticHandler{},
UDPSize: 1200,
}
go dnsServer.ListenAndServe()
time.Sleep(time.Second)
config := &core.Config{
App: []*anypb.Any{
serial.ToTypedMessage(&Config{
NameServers: []*net.Endpoint{
{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: 9999, /* unreachable */
},
},
NameServer: []*NameServer{
{
Address: &net.Endpoint{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: uint32(port),
},
PrioritizedDomain: []*NameServer_PriorityDomain{
{
Type: DomainMatchingType_Subdomain,
Domain: "google.com",
},
},
Geoip: []*routercommon.GeoIP{
{ // Will only match 8.8.8.8 and 8.8.4.4
Cidr: []*routercommon.CIDR{
{Ip: []byte{8, 8, 8, 8}, Prefix: 32},
{Ip: []byte{8, 8, 4, 4}, Prefix: 32},
},
},
},
},
{
Address: &net.Endpoint{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: uint32(port),
},
PrioritizedDomain: []*NameServer_PriorityDomain{
{
Type: DomainMatchingType_Subdomain,
Domain: "google.com",
},
},
Geoip: []*routercommon.GeoIP{
{ // Will match 8.8.8.8 and 8.8.8.7, etc
Cidr: []*routercommon.CIDR{
{Ip: []byte{8, 8, 8, 7}, Prefix: 24},
},
},
},
},
{
Address: &net.Endpoint{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: uint32(port),
},
PrioritizedDomain: []*NameServer_PriorityDomain{
{
Type: DomainMatchingType_Subdomain,
Domain: "api.google.com",
},
},
Geoip: []*routercommon.GeoIP{
{ // Will only match 8.8.7.7 (api.google.com)
Cidr: []*routercommon.CIDR{
{Ip: []byte{8, 8, 7, 7}, Prefix: 32},
},
},
},
},
{
Address: &net.Endpoint{
Network: net.Network_UDP,
Address: &net.IPOrDomain{
Address: &net.IPOrDomain_Ip{
Ip: []byte{127, 0, 0, 1},
},
},
Port: uint32(port),
},
PrioritizedDomain: []*NameServer_PriorityDomain{
{
Type: DomainMatchingType_Full,
Domain: "v2.api.google.com",
},
},
Geoip: []*routercommon.GeoIP{
{ // Will only match 8.8.7.8 (v2.api.google.com)
Cidr: []*routercommon.CIDR{
{Ip: []byte{8, 8, 7, 8}, Prefix: 32},
},
},
},
},
},
}),
serial.ToTypedMessage(&dispatcher.Config{}),
serial.ToTypedMessage(&proxyman.OutboundConfig{}),
serial.ToTypedMessage(&policy.Config{}),
},
Outbound: []*core.OutboundHandlerConfig{
{
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
},
},
}
v, err := core.New(config)
common.Must(err)
client := v.GetFeature(feature_dns.ClientType()).(feature_dns.Client)
startTime := time.Now()
{ // Will match server 1,2 and server 1 returns expected ip
ips, err := client.LookupIP("google.com")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{8, 8, 8, 8}}); r != "" {
t.Fatal(r)
}
}
{ // Will match server 1,2 and server 1 returns unexpected ip, then server 2 returns expected one
clientv4 := client.(feature_dns.IPv4Lookup)
ips, err := clientv4.LookupIPv4("ipv6.google.com")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{8, 8, 8, 7}}); r != "" {
t.Fatal(r)
}
}
{ // Will match server 3,1,2 and server 3 returns expected one
ips, err := client.LookupIP("api.google.com")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{8, 8, 7, 7}}); r != "" {
t.Fatal(r)
}
}
{ // Will match server 4,3,1,2 and server 4 returns expected one
ips, err := client.LookupIP("v2.api.google.com")
if err != nil {
t.Fatal("unexpected error: ", err)
}
if r := cmp.Diff(ips, []net.IP{{8, 8, 7, 8}}); r != "" {
t.Fatal(r)
}
}
endTime := time.Now()
if startTime.After(endTime.Add(time.Second * 2)) {
t.Error("DNS query doesn't finish in 2 seconds.")
}
}
================================================
FILE: app/dns/dnscommon.go
================================================
package dns
import (
"encoding/binary"
"strings"
"time"
"golang.org/x/net/dns/dnsmessage"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/errors"
"github.com/v2fly/v2ray-core/v5/common/net"
dns_feature "github.com/v2fly/v2ray-core/v5/features/dns"
)
// Fqdn normalizes domain make sure it ends with '.'
func Fqdn(domain string) string {
if len(domain) > 0 && strings.HasSuffix(domain, ".") {
return domain
}
return domain + "."
}
type record struct {
A *IPRecord
AAAA *IPRecord
}
// IPRecord is a cacheable item for a resolved domain
type IPRecord struct {
ReqID uint16
IP []net.Address
Expire time.Time
RCode dnsmessage.RCode
}
func (r *IPRecord) getIPs() ([]net.Address, er
gitextract_rgu_9fid/ ├── .github/ │ ├── CODE_OF_CONDUCT.md │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_cn.md │ │ ├── bug_en.md │ │ └── other_en.md │ ├── ISSUE_TEMPLATE.md │ ├── dependabot.yml │ └── workflows/ │ ├── codeql-analysis.yml │ ├── linter.yml │ ├── release.yml │ ├── sign.yml │ ├── stale.yml │ └── test.yml ├── .gitignore ├── LICENSE ├── README.md ├── SECURITY.md ├── annotations.go ├── app/ │ ├── app.go │ ├── browserforwarder/ │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ └── forwarder.go │ ├── commander/ │ │ ├── commander.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ ├── outbound.go │ │ ├── service.go │ │ └── webcommander/ │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ └── webcommander.go │ ├── dispatcher/ │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── default.go │ │ ├── dispatcher.go │ │ ├── errors.generated.go │ │ ├── fakednssniffer.go │ │ ├── sniffer.go │ │ ├── stats.go │ │ └── stats_test.go │ ├── dns/ │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── dns.go │ │ ├── dns_test.go │ │ ├── dnscommon.go │ │ ├── dnscommon_test.go │ │ ├── errors.generated.go │ │ ├── fakedns/ │ │ │ ├── errors.generated.go │ │ │ ├── fake.go │ │ │ ├── fakedns.go │ │ │ ├── fakedns.pb.go │ │ │ ├── fakedns.proto │ │ │ └── fakedns_test.go │ │ ├── fakedns.go │ │ ├── fakedns_test.go │ │ ├── hosts.go │ │ ├── hosts_test.go │ │ ├── nameserver.go │ │ ├── nameserver_doh.go │ │ ├── nameserver_doh_test.go │ │ ├── nameserver_fakedns.go │ │ ├── nameserver_local.go │ │ ├── nameserver_local_test.go │ │ ├── nameserver_quic.go │ │ ├── nameserver_quic_test.go │ │ ├── nameserver_tcp.go │ │ ├── nameserver_tcp_test.go │ │ └── nameserver_udp.go │ ├── instman/ │ │ ├── command/ │ │ │ ├── command.go │ │ │ ├── command.pb.go │ │ │ ├── command.proto │ │ │ └── command_grpc.pb.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ └── instman.go │ ├── log/ │ │ ├── command/ │ │ │ ├── command.go │ │ │ ├── command_test.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── config_grpc.pb.go │ │ │ └── errors.generated.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ ├── log.go │ │ ├── log_creator.go │ │ └── log_test.go │ ├── observatory/ │ │ ├── burst/ │ │ │ ├── burst.go │ │ │ ├── burstobserver.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── errors.generated.go │ │ │ ├── healthping.go │ │ │ ├── healthping_result.go │ │ │ ├── healthping_result_test.go │ │ │ └── ping.go │ │ ├── command/ │ │ │ ├── command.go │ │ │ ├── command.pb.go │ │ │ ├── command.proto │ │ │ ├── command_grpc.pb.go │ │ │ └── errors.generated.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ ├── explainErrors.go │ │ ├── multiobservatory/ │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ └── multi.go │ │ ├── observatory.go │ │ └── observer.go │ ├── persistentstorage/ │ │ ├── filesystemstorage/ │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ └── fs.go │ │ ├── protostorage/ │ │ │ └── protokv.go │ │ └── storage.go │ ├── policy/ │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ ├── manager.go │ │ ├── manager_test.go │ │ └── policy.go │ ├── proxyman/ │ │ ├── command/ │ │ │ ├── command.go │ │ │ ├── command.pb.go │ │ │ ├── command.proto │ │ │ ├── command_grpc.pb.go │ │ │ ├── doc.go │ │ │ └── errors.generated.go │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── inbound/ │ │ │ ├── always.go │ │ │ ├── dynamic.go │ │ │ ├── errors.generated.go │ │ │ ├── inbound.go │ │ │ └── worker.go │ │ └── outbound/ │ │ ├── errors.generated.go │ │ ├── handler.go │ │ ├── handler_test.go │ │ └── outbound.go │ ├── restfulapi/ │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ ├── restful_api.go │ │ ├── service.go │ │ └── service_test.go │ ├── reverse/ │ │ ├── bridge.go │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ ├── portal.go │ │ ├── portal_test.go │ │ └── reverse.go │ ├── router/ │ │ ├── balancing.go │ │ ├── balancing_override.go │ │ ├── command/ │ │ │ ├── command.go │ │ │ ├── command.pb.go │ │ │ ├── command.proto │ │ │ ├── command_grpc.pb.go │ │ │ ├── command_test.go │ │ │ ├── config.go │ │ │ └── errors.generated.go │ │ ├── condition.go │ │ ├── condition_geoip.go │ │ ├── condition_geoip_test.go │ │ ├── condition_test.go │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ ├── router.go │ │ ├── router_test.go │ │ ├── routercommon/ │ │ │ ├── common.pb.go │ │ │ └── common.proto │ │ ├── strategy_leastload.go │ │ ├── strategy_leastload_test.go │ │ ├── strategy_leastping.go │ │ ├── strategy_random.go │ │ ├── weight.go │ │ └── weight_test.go │ ├── stats/ │ │ ├── channel.go │ │ ├── channel_test.go │ │ ├── command/ │ │ │ ├── command.go │ │ │ ├── command.pb.go │ │ │ ├── command.proto │ │ │ ├── command_grpc.pb.go │ │ │ ├── command_test.go │ │ │ └── errors.generated.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── counter.go │ │ ├── counter_test.go │ │ ├── errors.generated.go │ │ ├── stats.go │ │ └── stats_test.go │ ├── subscription/ │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── containers/ │ │ │ ├── base64urlline/ │ │ │ │ ├── base64urlline.go │ │ │ │ ├── errors.generated.go │ │ │ │ └── parser.go │ │ │ ├── containers.go │ │ │ ├── dataurlsingle/ │ │ │ │ ├── dataurl.go │ │ │ │ └── errors.generated.go │ │ │ ├── errors.generated.go │ │ │ ├── jsonfieldarray/ │ │ │ │ ├── errors.generated.go │ │ │ │ ├── jsonfieldarray.go │ │ │ │ ├── jsonified/ │ │ │ │ │ ├── errors.generated.go │ │ │ │ │ ├── jsonified.go │ │ │ │ │ └── parser.go │ │ │ │ └── parser.go │ │ │ ├── tryall.go │ │ │ └── urlline/ │ │ │ ├── errors.generated.go │ │ │ ├── parser.go │ │ │ └── urlline.go │ │ ├── documentfetcher/ │ │ │ ├── dataurlfetcher/ │ │ │ │ ├── dataurl.go │ │ │ │ └── errors.generated.go │ │ │ ├── errors.generated.go │ │ │ ├── fetcher.go │ │ │ └── httpfetcher/ │ │ │ ├── errors.generated.go │ │ │ └── http.go │ │ ├── entries/ │ │ │ ├── entries.go │ │ │ ├── errors.generated.go │ │ │ ├── nonnative/ │ │ │ │ ├── converter.go │ │ │ │ ├── definitions/ │ │ │ │ │ ├── shadowsocks.jsont │ │ │ │ │ ├── shadowsocks2022.jsont │ │ │ │ │ └── vmess.jsont │ │ │ │ ├── errors.generated.go │ │ │ │ ├── matchdef.go │ │ │ │ ├── nonnative.go │ │ │ │ └── nonnativeifce/ │ │ │ │ └── nonnativeifce.go │ │ │ ├── outbound/ │ │ │ │ ├── errors.generated.go │ │ │ │ └── outbound.go │ │ │ └── register.go │ │ ├── errors.generated.go │ │ ├── specs/ │ │ │ ├── abstract_spec.pb.go │ │ │ ├── abstract_spec.proto │ │ │ ├── errors.generated.go │ │ │ ├── outbound_parser.go │ │ │ ├── skeleton.go │ │ │ └── specs.go │ │ ├── subscription.go │ │ ├── subscription_rpc.pb.go │ │ ├── subscription_rpc.proto │ │ └── subscriptionmanager/ │ │ ├── command/ │ │ │ ├── command.go │ │ │ ├── command.pb.go │ │ │ ├── command.proto │ │ │ ├── command_grpc.pb.go │ │ │ └── errors.generated.go │ │ ├── delta.go │ │ ├── errors.generated.go │ │ ├── known_metadata.go │ │ ├── manager.go │ │ ├── manager_rpc.go │ │ ├── serverspec_materialize.go │ │ ├── subdocapplier.go │ │ ├── subdocchecker.go │ │ ├── subdocupdater.go │ │ └── tracked_subscription.go │ └── tun/ │ ├── config.pb.go │ ├── config.proto │ ├── device/ │ │ ├── device.go │ │ ├── errors.generated.go │ │ ├── gvisor/ │ │ │ ├── errors.generated.go │ │ │ ├── gvisor.go │ │ │ ├── gvisor_linux.go │ │ │ └── gvisor_others.go │ │ └── linkWriterToWriter.go │ ├── errors.generated.go │ ├── handler.go │ ├── handler_tcp.go │ ├── handler_udp.go │ ├── net/ │ │ └── net.go │ ├── option.go │ ├── packetaddradaptar.go │ ├── packetparse/ │ │ ├── errors.generated.go │ │ ├── packetParse.go │ │ └── udp.go │ ├── stack.go │ ├── tun.go │ └── tunsorter/ │ ├── errors.generated.go │ └── tunsorter.go ├── common/ │ ├── antireplay/ │ │ ├── antireplay.go │ │ ├── bloomring.go │ │ └── replayfilter.go │ ├── bitmask/ │ │ ├── byte.go │ │ └── byte_test.go │ ├── buf/ │ │ ├── buf.go │ │ ├── buffer.go │ │ ├── buffer_test.go │ │ ├── copy.go │ │ ├── copy_test.go │ │ ├── errors.generated.go │ │ ├── io.go │ │ ├── io_test.go │ │ ├── multi_buffer.go │ │ ├── multi_buffer_test.go │ │ ├── reader.go │ │ ├── reader_test.go │ │ ├── readv_posix.go │ │ ├── readv_reader.go │ │ ├── readv_reader_wasm.go │ │ ├── readv_test.go │ │ ├── readv_unix.go │ │ ├── readv_windows.go │ │ ├── writer.go │ │ └── writer_test.go │ ├── bytespool/ │ │ └── pool.go │ ├── cache/ │ │ ├── lru.go │ │ └── lru_test.go │ ├── cmdarg/ │ │ ├── arg.go │ │ ├── cmdarg.go │ │ └── errors.generated.go │ ├── common.go │ ├── common_test.go │ ├── crypto/ │ │ ├── aes.go │ │ ├── auth.go │ │ ├── auth_test.go │ │ ├── benchmark_test.go │ │ ├── chacha20.go │ │ ├── chacha20_test.go │ │ ├── chunk.go │ │ ├── chunk_test.go │ │ ├── crypto.go │ │ ├── errors.generated.go │ │ ├── internal/ │ │ │ ├── chacha.go │ │ │ ├── chacha_core.generated.go │ │ │ └── chacha_core_gen.go │ │ └── io.go │ ├── dice/ │ │ ├── dice.go │ │ └── dice_test.go │ ├── drain/ │ │ ├── drain.go │ │ ├── drainer.go │ │ └── errors.generated.go │ ├── dualStack/ │ │ ├── fusedPacketConn/ │ │ │ └── fusedPacketSocket.go │ │ └── happyEyeball/ │ │ └── racingDialer.go │ ├── environment/ │ │ ├── app.go │ │ ├── base.go │ │ ├── connection.go │ │ ├── deferredpersistentstorage/ │ │ │ └── defereredPersistentStorage.go │ │ ├── envctx/ │ │ │ └── env.go │ │ ├── envimpl/ │ │ │ └── fs.go │ │ ├── filesystemcap/ │ │ │ └── fscap.go │ │ ├── filesystemimpl/ │ │ │ └── fsimpl.go │ │ ├── proxy.go │ │ ├── rootcap.go │ │ ├── rootcap_impl.go │ │ ├── systemnetworkimpl/ │ │ │ └── systemnetwork.go │ │ ├── transientstorageimpl/ │ │ │ ├── errors.generated.go │ │ │ └── storage.go │ │ └── transport.go │ ├── errors/ │ │ ├── errors.go │ │ ├── errors_test.go │ │ └── multi_error.go │ ├── errors.generated.go │ ├── interfaces.go │ ├── log/ │ │ ├── access.go │ │ ├── log.go │ │ ├── log.pb.go │ │ ├── log.proto │ │ ├── log_test.go │ │ ├── logger.go │ │ └── logger_test.go │ ├── mux/ │ │ ├── client.go │ │ ├── client_test.go │ │ ├── errors.generated.go │ │ ├── frame.go │ │ ├── frame_test.go │ │ ├── mux.go │ │ ├── mux_test.go │ │ ├── reader.go │ │ ├── server.go │ │ ├── session.go │ │ ├── session_test.go │ │ └── writer.go │ ├── natTraversal/ │ │ └── stun/ │ │ ├── filteredStunConnection.go │ │ ├── natTypeTest.go │ │ ├── processor.go │ │ ├── stunClientConn.go │ │ └── stuncli/ │ │ └── stuncli.go │ ├── net/ │ │ ├── abstactOutbount/ │ │ │ ├── errors.generated.go │ │ │ └── outbound.go │ │ ├── address.go │ │ ├── address.pb.go │ │ ├── address.proto │ │ ├── address_test.go │ │ ├── connection.go │ │ ├── destination.go │ │ ├── destination.pb.go │ │ ├── destination.proto │ │ ├── destination_test.go │ │ ├── errors.generated.go │ │ ├── net.go │ │ ├── network.go │ │ ├── network.pb.go │ │ ├── network.proto │ │ ├── packetaddr/ │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── connection_adaptor.go │ │ │ ├── packetaddr.go │ │ │ ├── packetaddr_test.go │ │ │ └── special_address.go │ │ ├── port.go │ │ ├── port.pb.go │ │ ├── port.proto │ │ ├── port_test.go │ │ └── system.go │ ├── packetswitch/ │ │ ├── gvisorstack/ │ │ │ ├── adapter.go │ │ │ ├── adapter_test.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── dialer.go │ │ │ ├── stack.go │ │ │ └── tcp_listener.go │ │ ├── interconnect/ │ │ │ ├── interconnect.go │ │ │ ├── networkLayer_cable.go │ │ │ └── networkLayer_cable_test.go │ │ └── packetswitch.go │ ├── peer/ │ │ ├── latency.go │ │ └── peer.go │ ├── platform/ │ │ ├── ctlcmd/ │ │ │ └── attr_other.go │ │ ├── filesystem/ │ │ │ ├── file.go │ │ │ └── fsifce/ │ │ │ └── ifce.go │ │ ├── others.go │ │ ├── platform.go │ │ ├── platform_test.go │ │ ├── securedload/ │ │ │ ├── embedded.go │ │ │ ├── embeddedhash.go │ │ │ ├── errors.generated.go │ │ │ ├── file.go │ │ │ ├── securedload.go │ │ │ └── verify.go │ │ └── windows.go │ ├── protocol/ │ │ ├── account.go │ │ ├── address.go │ │ ├── address_test.go │ │ ├── bittorrent/ │ │ │ └── bittorrent.go │ │ ├── context.go │ │ ├── dns/ │ │ │ ├── errors.generated.go │ │ │ └── io.go │ │ ├── errors.generated.go │ │ ├── headers.go │ │ ├── headers.pb.go │ │ ├── headers.proto │ │ ├── http/ │ │ │ ├── headers.go │ │ │ ├── headers_test.go │ │ │ ├── sniff.go │ │ │ └── sniff_test.go │ │ ├── id.go │ │ ├── id_test.go │ │ ├── payload.go │ │ ├── protocol.go │ │ ├── quic/ │ │ │ ├── cipher_suite.go │ │ │ ├── sniff.go │ │ │ └── sniff_test.go │ │ ├── server_picker.go │ │ ├── server_picker_test.go │ │ ├── server_spec.go │ │ ├── server_spec.pb.go │ │ ├── server_spec.proto │ │ ├── server_spec_test.go │ │ ├── time.go │ │ ├── time_test.go │ │ ├── tls/ │ │ │ ├── cert/ │ │ │ │ ├── .gitignore │ │ │ │ ├── cert.go │ │ │ │ ├── cert_test.go │ │ │ │ ├── errors.generated.go │ │ │ │ └── privateKey.go │ │ │ ├── sniff.go │ │ │ └── sniff_test.go │ │ ├── udp/ │ │ │ ├── packet.go │ │ │ └── udp.go │ │ ├── user.go │ │ ├── user.pb.go │ │ └── user.proto │ ├── protoext/ │ │ ├── errors.generated.go │ │ ├── extensions.go │ │ ├── extensions.pb.go │ │ ├── extensions.proto │ │ └── testing/ │ │ ├── extension_test.go │ │ ├── test.pb.go │ │ └── test.proto │ ├── protofilter/ │ │ ├── errors.generated.go │ │ └── filter.go │ ├── registry/ │ │ ├── errors.generated.go │ │ ├── implementation_set.go │ │ ├── registry.go │ │ └── restrict.go │ ├── retry/ │ │ ├── errors.generated.go │ │ ├── retry.go │ │ └── retry_test.go │ ├── serial/ │ │ ├── resolver.go │ │ ├── serial.go │ │ ├── serial_test.go │ │ ├── string.go │ │ ├── string_test.go │ │ ├── typed_message.go │ │ └── typed_message_test.go │ ├── session/ │ │ ├── context.go │ │ └── session.go │ ├── signal/ │ │ ├── done/ │ │ │ └── done.go │ │ ├── notifier.go │ │ ├── notifier_test.go │ │ ├── pubsub/ │ │ │ ├── pubsub.go │ │ │ └── pubsub_test.go │ │ ├── semaphore/ │ │ │ └── semaphore.go │ │ ├── timer.go │ │ └── timer_test.go │ ├── strmatcher/ │ │ ├── benchmark_indexmatcher_test.go │ │ ├── benchmark_matchers_test.go │ │ ├── indexmatcher_linear.go │ │ ├── indexmatcher_linear_test.go │ │ ├── indexmatcher_mph.go │ │ ├── indexmatcher_mph_test.go │ │ ├── matchergroup_ac_automation.go │ │ ├── matchergroup_ac_automation_test.go │ │ ├── matchergroup_domain.go │ │ ├── matchergroup_domain_test.go │ │ ├── matchergroup_full.go │ │ ├── matchergroup_full_test.go │ │ ├── matchergroup_mph.go │ │ ├── matchergroup_mph_test.go │ │ ├── matchergroup_simple.go │ │ ├── matchergroup_simple_test.go │ │ ├── matchergroup_substr.go │ │ ├── matchergroup_substr_test.go │ │ ├── matchers.go │ │ ├── matchers_test.go │ │ └── strmatcher.go │ ├── taggedfeatures/ │ │ ├── configloader.go │ │ ├── creator.go │ │ ├── errors.generated.go │ │ ├── holder.go │ │ ├── skeleton.pb.go │ │ ├── skeleton.proto │ │ └── taggedfeatures.go │ ├── task/ │ │ ├── common.go │ │ ├── periodic.go │ │ ├── periodic_test.go │ │ ├── task.go │ │ ├── taskDerive/ │ │ │ ├── derive.go │ │ │ ├── errors.generated.go │ │ │ └── tryAll.go │ │ └── task_test.go │ ├── type.go │ ├── type_test.go │ ├── units/ │ │ ├── bytesize.go │ │ └── bytesize_test.go │ └── uuid/ │ ├── uuid.go │ └── uuid_test.go ├── config.go ├── config.pb.go ├── config.proto ├── context.go ├── context_test.go ├── core.go ├── errors.generated.go ├── features/ │ ├── dns/ │ │ ├── client.go │ │ ├── fakedns.go │ │ └── localdns/ │ │ ├── client.go │ │ └── errors.generated.go │ ├── errors.generated.go │ ├── extension/ │ │ ├── browser.go │ │ ├── contextreceiver.go │ │ ├── instance.go │ │ ├── observatory.go │ │ ├── storage/ │ │ │ └── storage.go │ │ └── storage.go │ ├── feature.go │ ├── inbound/ │ │ └── inbound.go │ ├── outbound/ │ │ └── outbound.go │ ├── policy/ │ │ ├── default.go │ │ └── policy.go │ ├── routing/ │ │ ├── balancer.go │ │ ├── context.go │ │ ├── dispatcher.go │ │ ├── dns/ │ │ │ ├── context.go │ │ │ └── errors.generated.go │ │ ├── router.go │ │ └── session/ │ │ └── context.go │ └── stats/ │ ├── errors.generated.go │ └── stats.go ├── format.go ├── functions.go ├── functions_test.go ├── go.mod ├── go.sum ├── infra/ │ ├── conf/ │ │ ├── cfgcommon/ │ │ │ ├── buildable.go │ │ │ ├── common.go │ │ │ ├── common_test.go │ │ │ ├── duration/ │ │ │ │ ├── duration.go │ │ │ │ └── duration_test.go │ │ │ ├── errors.generated.go │ │ │ ├── loader/ │ │ │ │ ├── errors.generated.go │ │ │ │ └── loader.go │ │ │ ├── muxcfg/ │ │ │ │ └── mux.go │ │ │ ├── proxycfg/ │ │ │ │ ├── errors.generated.go │ │ │ │ └── proxy.go │ │ │ ├── session.go │ │ │ ├── sniffer/ │ │ │ │ ├── errors.generated.go │ │ │ │ └── sniffer.go │ │ │ ├── socketcfg/ │ │ │ │ └── socket.go │ │ │ ├── testassist/ │ │ │ │ └── general.go │ │ │ └── tlscfg/ │ │ │ ├── errors.generated.go │ │ │ └── tls.go │ │ ├── geodata/ │ │ │ ├── attr.go │ │ │ ├── errors.generated.go │ │ │ ├── geodata.go │ │ │ ├── geodata_test.go │ │ │ ├── geodataproto.go │ │ │ ├── memconservative/ │ │ │ │ ├── cache.go │ │ │ │ ├── decode.go │ │ │ │ ├── decode_test.go │ │ │ │ ├── errors.generated.go │ │ │ │ └── memc.go │ │ │ └── standard/ │ │ │ ├── errors.generated.go │ │ │ └── standard.go │ │ ├── json/ │ │ │ ├── json_test.go │ │ │ ├── reader.go │ │ │ ├── reader_test.go │ │ │ ├── toml.go │ │ │ ├── toml_test.go │ │ │ ├── yaml.go │ │ │ └── yaml_test.go │ │ ├── jsonpb/ │ │ │ ├── errors.generated.go │ │ │ └── jsonpb.go │ │ ├── merge/ │ │ │ ├── errors.generated.go │ │ │ ├── map.go │ │ │ ├── merge.go │ │ │ ├── merge_test.go │ │ │ ├── priority.go │ │ │ ├── rules.go │ │ │ └── tag.go │ │ ├── mergers/ │ │ │ ├── errors.generated.go │ │ │ ├── extensions.go │ │ │ ├── merge.go │ │ │ ├── merger_base.go │ │ │ ├── mergers.go │ │ │ └── names.go │ │ ├── rule/ │ │ │ ├── errors.generated.go │ │ │ ├── rule.go │ │ │ └── rule_test.go │ │ ├── serial/ │ │ │ ├── errors.generated.go │ │ │ ├── loader.go │ │ │ ├── loader_test.go │ │ │ └── serial.go │ │ ├── synthetic/ │ │ │ ├── dns/ │ │ │ │ ├── dns.go │ │ │ │ ├── dns_test.go │ │ │ │ ├── errors.generated.go │ │ │ │ └── fakedns.go │ │ │ ├── log/ │ │ │ │ └── log.go │ │ │ └── router/ │ │ │ ├── errors.generated.go │ │ │ ├── router.go │ │ │ ├── router_strategy.go │ │ │ └── router_test.go │ │ ├── v2jsonpb/ │ │ │ ├── any2.go │ │ │ ├── errors.generated.go │ │ │ ├── follower.go │ │ │ ├── followerany.go │ │ │ ├── followerlist.go │ │ │ ├── followermap.go │ │ │ └── v2jsonpb.go │ │ ├── v4/ │ │ │ ├── api.go │ │ │ ├── blackhole.go │ │ │ ├── blackhole_test.go │ │ │ ├── browser_forwarder.go │ │ │ ├── conf.go │ │ │ ├── dns_proxy.go │ │ │ ├── dns_proxy_test.go │ │ │ ├── dokodemo.go │ │ │ ├── dokodemo_test.go │ │ │ ├── errors.generated.go │ │ │ ├── freedom.go │ │ │ ├── freedom_test.go │ │ │ ├── gun.go │ │ │ ├── http.go │ │ │ ├── http_test.go │ │ │ ├── hysteria2.go │ │ │ ├── lint.go │ │ │ ├── loopback.go │ │ │ ├── observatory.go │ │ │ ├── policy.go │ │ │ ├── policy_test.go │ │ │ ├── reverse.go │ │ │ ├── reverse_test.go │ │ │ ├── services.go │ │ │ ├── shadowsocks.go │ │ │ ├── shadowsocks_test.go │ │ │ ├── socks.go │ │ │ ├── socks_test.go │ │ │ ├── transport.go │ │ │ ├── transport_authenticators.go │ │ │ ├── transport_internet.go │ │ │ ├── transport_test.go │ │ │ ├── trojan.go │ │ │ ├── v2ray.go │ │ │ ├── v2ray_test.go │ │ │ ├── vless.go │ │ │ ├── vless_test.go │ │ │ ├── vmess.go │ │ │ └── vmess_test.go │ │ └── v5cfg/ │ │ ├── common.go │ │ ├── errors.generated.go │ │ ├── inbound.go │ │ ├── init.go │ │ ├── outbound.go │ │ ├── root.go │ │ ├── skeleton.go │ │ ├── stream.go │ │ └── v5cfg.go │ └── vformat/ │ └── main.go ├── main/ │ ├── commands/ │ │ ├── all/ │ │ │ ├── api/ │ │ │ │ ├── api.go │ │ │ │ ├── balancer_info.go │ │ │ │ ├── balancer_override.go │ │ │ │ ├── jsonv4/ │ │ │ │ │ ├── inbounds_add.go │ │ │ │ │ ├── inbounds_remove.go │ │ │ │ │ ├── init.go │ │ │ │ │ ├── outbounds_add.go │ │ │ │ │ └── outbounds_remove.go │ │ │ │ ├── log.go │ │ │ │ ├── shared.go │ │ │ │ └── stats.go │ │ │ ├── commands.go │ │ │ ├── engineering/ │ │ │ │ ├── convertpb.go │ │ │ │ ├── encodedataurl.go │ │ │ │ ├── engineering.go │ │ │ │ ├── errors.generated.go │ │ │ │ ├── generateRandomData/ │ │ │ │ │ ├── errors.generated.go │ │ │ │ │ └── generateRandomData.go │ │ │ │ ├── nonnativelinkexec.go │ │ │ │ ├── nonnativelinkextract.go │ │ │ │ ├── reversepb.go │ │ │ │ └── subscriptionEntriesExtract.go │ │ │ ├── errors.generated.go │ │ │ ├── format_doc.go │ │ │ ├── jsonv4/ │ │ │ │ ├── convert.go │ │ │ │ └── init.go │ │ │ ├── love.go │ │ │ ├── merge_doc.go │ │ │ ├── tls/ │ │ │ │ ├── cert.go │ │ │ │ ├── chainhash.go │ │ │ │ ├── ping.go │ │ │ │ └── tls.go │ │ │ ├── uuid.go │ │ │ └── verify.go │ │ ├── base/ │ │ │ ├── command.go │ │ │ ├── env.go │ │ │ ├── execute.go │ │ │ ├── help.go │ │ │ └── root.go │ │ ├── errors.generated.go │ │ ├── helpers/ │ │ │ ├── config_load.go │ │ │ └── fs.go │ │ ├── run.go │ │ ├── test.go │ │ └── version.go │ ├── distro/ │ │ ├── all/ │ │ │ ├── all.go │ │ │ ├── pion.go │ │ │ └── wireguard.go │ │ └── debug/ │ │ └── debug.go │ ├── errors.generated.go │ ├── formats/ │ │ ├── errors.generated.go │ │ └── formats.go │ ├── main.go │ ├── main_test.go │ ├── plugins/ │ │ ├── plugin.go │ │ └── plugin_pprof/ │ │ └── plugin_pprof.go │ └── v2binding/ │ ├── startUp.go │ ├── v2api/ │ │ └── api.go │ └── v2binding.go ├── mocks.go ├── proto.go ├── proxy/ │ ├── blackhole/ │ │ ├── blackhole.go │ │ ├── blackhole_test.go │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── config_test.go │ │ └── errors.generated.go │ ├── dns/ │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── dns.go │ │ ├── dns_test.go │ │ └── errors.generated.go │ ├── dokodemo/ │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── dokodemo.go │ │ └── errors.generated.go │ ├── freedom/ │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ └── freedom.go │ ├── http/ │ │ ├── client.go │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ ├── http.go │ │ ├── server.go │ │ └── simplified/ │ │ ├── config.go │ │ ├── config.pb.go │ │ └── config.proto │ ├── hysteria2/ │ │ ├── client.go │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ ├── hysteria2.go │ │ ├── protocol.go │ │ └── server.go │ ├── loopback/ │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ └── loopback.go │ ├── proxy.go │ ├── shadowsocks/ │ │ ├── client.go │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── config_test.go │ │ ├── errors.generated.go │ │ ├── protocol.go │ │ ├── protocol_test.go │ │ ├── server.go │ │ ├── shadowsocks.go │ │ └── simplified/ │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ └── errors.generated.go │ ├── shadowsocks2022/ │ │ ├── client.go │ │ ├── client_session.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── eih_aes.go │ │ ├── encoding.go │ │ ├── errors.generated.go │ │ ├── kdf_blake3.go │ │ ├── method_aes128gcm.go │ │ ├── method_aes256gcm.go │ │ ├── requestsalt.go │ │ ├── ss2022.go │ │ └── udp_aes.go │ ├── socks/ │ │ ├── client.go │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ ├── protocol.go │ │ ├── protocol_test.go │ │ ├── server.go │ │ ├── simplified/ │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ └── config.proto │ │ └── socks.go │ ├── trojan/ │ │ ├── client.go │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ ├── protocol.go │ │ ├── protocol_test.go │ │ ├── server.go │ │ ├── simplified/ │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ └── config.proto │ │ ├── trojan.go │ │ └── validator.go │ ├── vless/ │ │ ├── account.go │ │ ├── account.pb.go │ │ ├── account.proto │ │ ├── encoding/ │ │ │ ├── addons.go │ │ │ ├── addons.pb.go │ │ │ ├── addons.proto │ │ │ ├── encoding.go │ │ │ ├── encoding_test.go │ │ │ └── errors.generated.go │ │ ├── errors.generated.go │ │ ├── inbound/ │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── errors.generated.go │ │ │ └── inbound.go │ │ ├── outbound/ │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── errors.generated.go │ │ │ └── outbound.go │ │ ├── validator.go │ │ └── vless.go │ ├── vlite/ │ │ ├── inbound/ │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── connAdp.go │ │ │ ├── errors.generated.go │ │ │ └── inbound.go │ │ ├── outbound/ │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── errors.generated.go │ │ │ └── outbound.go │ │ └── vlite.go │ ├── vmess/ │ │ ├── account.go │ │ ├── account.pb.go │ │ ├── account.proto │ │ ├── aead/ │ │ │ ├── authid.go │ │ │ ├── authid_test.go │ │ │ ├── consts.go │ │ │ ├── encrypt.go │ │ │ ├── encrypt_test.go │ │ │ ├── kdf.go │ │ │ └── kdf_test.go │ │ ├── encoding/ │ │ │ ├── auth.go │ │ │ ├── auth_test.go │ │ │ ├── client.go │ │ │ ├── commands.go │ │ │ ├── commands_test.go │ │ │ ├── encoding.go │ │ │ ├── encoding_test.go │ │ │ ├── errors.generated.go │ │ │ └── server.go │ │ ├── errors.generated.go │ │ ├── inbound/ │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── errors.generated.go │ │ │ └── inbound.go │ │ ├── outbound/ │ │ │ ├── command.go │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── errors.generated.go │ │ │ └── outbound.go │ │ ├── validator.go │ │ ├── validator_test.go │ │ ├── vmess.go │ │ └── vmessCtxInterface.go │ └── wireguard/ │ ├── outbound/ │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── errors.generated.go │ │ └── outbound.go │ └── wgcommon/ │ ├── config.pb.go │ ├── config.proto │ ├── errors.generated.go │ ├── filterDebug.go │ ├── setup.go │ ├── wgConnAdaptor.go │ ├── wgConnAdaptor_test.go │ ├── wgDeviceAdaptor.go │ ├── wgDeviceAdaptor_test.go │ ├── wgLogAdaptor.go │ ├── wgcommon.go │ └── wgdevice.go ├── release/ │ ├── config/ │ │ ├── config.json │ │ ├── systemd/ │ │ │ └── system/ │ │ │ ├── v2ray.service │ │ │ └── v2ray@.service │ │ ├── vpoint_socks_vmess.json │ │ └── vpoint_vmess_freedom.json │ ├── container/ │ │ ├── Containerfile │ │ └── downloadAssets.sh │ ├── debian/ │ │ ├── changelog │ │ ├── control │ │ ├── copyright │ │ ├── rules │ │ ├── source/ │ │ │ └── format │ │ ├── v2ray-docs.docs │ │ ├── v2ray-domain-list-community.install │ │ ├── v2ray-geoip-only-cn-private.install │ │ ├── v2ray-geoip.install │ │ ├── v2ray.install │ │ ├── v2ray.service │ │ └── v2ray@.service │ ├── extra/ │ │ └── browserforwarder/ │ │ ├── index.html │ │ └── index.js │ ├── friendly-filenames.json │ ├── install-release.sh │ ├── requestsign.sh │ └── user-package.sh ├── testing/ │ ├── mocks/ │ │ ├── dns.go │ │ ├── io.go │ │ ├── log.go │ │ ├── mux.go │ │ ├── outbound.go │ │ └── proxy.go │ ├── scenarios/ │ │ ├── cert/ │ │ │ ├── self-signed_cert.pem │ │ │ └── self-signed_key.pem │ │ ├── command_test.go │ │ ├── common.go │ │ ├── common_coverage.go │ │ ├── common_instanceMgr.go │ │ ├── common_instanceMgr_test.go │ │ ├── common_regular.go │ │ ├── config/ │ │ │ ├── grpc_client.json │ │ │ ├── grpc_server.json │ │ │ ├── grpc_servicename_client.json │ │ │ ├── grpc_servicename_server.json │ │ │ ├── httpupgrade_client.json │ │ │ ├── httpupgrade_earlydataShortEarlyData_client.json │ │ │ ├── httpupgrade_earlydataShortEarlyData_server.json │ │ │ ├── httpupgrade_earlydata_client.json │ │ │ ├── httpupgrade_earlydata_server.json │ │ │ ├── httpupgrade_server.json │ │ │ ├── meek_client.json │ │ │ ├── meek_server.json │ │ │ ├── mekya_client.json │ │ │ └── mekya_server.json │ │ ├── dns_test.go │ │ ├── dokodemo_test.go │ │ ├── feature_test.go │ │ ├── grpc_test.go │ │ ├── http_test.go │ │ ├── httpupgrade_test.go │ │ ├── hy2_test.go │ │ ├── meek_test.go │ │ ├── mekya_test.go │ │ ├── policy_test.go │ │ ├── reverse_test.go │ │ ├── shadowsocks_test.go │ │ ├── socks_test.go │ │ ├── tls_test.go │ │ ├── transport_test.go │ │ └── vmess_test.go │ └── servers/ │ ├── http/ │ │ └── http.go │ ├── tcp/ │ │ ├── port.go │ │ └── tcp.go │ └── udp/ │ ├── port.go │ └── udp.go ├── transport/ │ ├── config.go │ ├── config.pb.go │ ├── config.proto │ ├── internet/ │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── connection.go │ │ ├── dialer.go │ │ ├── dialer_test.go │ │ ├── domainsocket/ │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── dial.go │ │ │ ├── errgen.go │ │ │ ├── errors.generated.go │ │ │ ├── listener.go │ │ │ └── listener_test.go │ │ ├── dtls/ │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── dialer.go │ │ │ ├── dtls.go │ │ │ ├── errors.generated.go │ │ │ └── listener.go │ │ ├── errors.generated.go │ │ ├── filelocker.go │ │ ├── filelocker_other.go │ │ ├── filelocker_windows.go │ │ ├── grpc/ │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── dial.go │ │ │ ├── encoding/ │ │ │ │ ├── conn.go │ │ │ │ ├── customSeviceName.go │ │ │ │ ├── encoding.go │ │ │ │ ├── errors.generated.go │ │ │ │ ├── stream.pb.go │ │ │ │ ├── stream.proto │ │ │ │ └── stream_grpc.pb.go │ │ │ ├── errors.generated.go │ │ │ ├── grpc.go │ │ │ └── hub.go │ │ ├── header.go │ │ ├── header_test.go │ │ ├── headers/ │ │ │ ├── http/ │ │ │ │ ├── config.go │ │ │ │ ├── config.pb.go │ │ │ │ ├── config.proto │ │ │ │ ├── errors.generated.go │ │ │ │ ├── http.go │ │ │ │ ├── http_test.go │ │ │ │ ├── linkedreadRequest.go │ │ │ │ └── resp.go │ │ │ ├── noop/ │ │ │ │ ├── config.pb.go │ │ │ │ ├── config.proto │ │ │ │ └── noop.go │ │ │ ├── srtp/ │ │ │ │ ├── config.pb.go │ │ │ │ ├── config.proto │ │ │ │ ├── srtp.go │ │ │ │ └── srtp_test.go │ │ │ ├── tls/ │ │ │ │ ├── config.pb.go │ │ │ │ ├── config.proto │ │ │ │ ├── dtls.go │ │ │ │ └── dtls_test.go │ │ │ ├── utp/ │ │ │ │ ├── config.pb.go │ │ │ │ ├── config.proto │ │ │ │ ├── utp.go │ │ │ │ └── utp_test.go │ │ │ ├── wechat/ │ │ │ │ ├── config.pb.go │ │ │ │ ├── config.proto │ │ │ │ ├── wechat.go │ │ │ │ └── wechat_test.go │ │ │ └── wireguard/ │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ └── wireguard.go │ │ ├── http/ │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── dialer.go │ │ │ ├── errors.generated.go │ │ │ ├── http.go │ │ │ ├── http_test.go │ │ │ └── hub.go │ │ ├── httpupgrade/ │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── connection.go │ │ │ ├── dialer.go │ │ │ ├── errors.generated.go │ │ │ ├── httpupgrade.go │ │ │ └── hub.go │ │ ├── hysteria2/ │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── conn.go │ │ │ ├── dialer.go │ │ │ ├── errors.generated.go │ │ │ ├── hub.go │ │ │ ├── hy2_transport_test.go │ │ │ └── hysteria2.go │ │ ├── internet.go │ │ ├── kcp/ │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── connection.go │ │ │ ├── connection_test.go │ │ │ ├── crypt.go │ │ │ ├── crypt_test.go │ │ │ ├── cryptreal.go │ │ │ ├── dialer.go │ │ │ ├── errors.generated.go │ │ │ ├── io.go │ │ │ ├── io_test.go │ │ │ ├── kcp.go │ │ │ ├── kcp_test.go │ │ │ ├── listener.go │ │ │ ├── output.go │ │ │ ├── receiving.go │ │ │ ├── segment.go │ │ │ ├── segment_test.go │ │ │ ├── sending.go │ │ │ ├── xor.go │ │ │ ├── xor_amd64.go │ │ │ └── xor_amd64.s │ │ ├── memory_settings.go │ │ ├── quic/ │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── conn.go │ │ │ ├── dialer.go │ │ │ ├── errors.generated.go │ │ │ ├── hub.go │ │ │ ├── pool.go │ │ │ ├── quic.go │ │ │ └── quic_test.go │ │ ├── request/ │ │ │ ├── assembler/ │ │ │ │ ├── packetconn/ │ │ │ │ │ ├── errors.generated.go │ │ │ │ │ ├── packetConn.pb.go │ │ │ │ │ ├── packetConn.proto │ │ │ │ │ ├── packetbundle.go │ │ │ │ │ ├── packetconn.go │ │ │ │ │ ├── req2packet.go │ │ │ │ │ ├── udpassembler.go │ │ │ │ │ ├── udpassemblerClient.go │ │ │ │ │ └── udpassemblerServer.go │ │ │ │ └── simple/ │ │ │ │ ├── client.go │ │ │ │ ├── config.pb.go │ │ │ │ ├── config.proto │ │ │ │ ├── errors.generated.go │ │ │ │ ├── server.go │ │ │ │ └── simple.go │ │ │ ├── assembler.go │ │ │ ├── assembly/ │ │ │ │ ├── assembly.go │ │ │ │ ├── config.pb.go │ │ │ │ ├── config.proto │ │ │ │ ├── dialer.go │ │ │ │ ├── errors.generated.go │ │ │ │ └── hub.go │ │ │ ├── options.go │ │ │ ├── request.go │ │ │ ├── reverser.go │ │ │ ├── roundtripper/ │ │ │ │ └── httprt/ │ │ │ │ ├── config.pb.go │ │ │ │ ├── config.proto │ │ │ │ ├── errors.generated.go │ │ │ │ └── httprt.go │ │ │ ├── roundtripper.go │ │ │ ├── roundtripperreverserserver/ │ │ │ │ ├── accesschecker_password.go │ │ │ │ ├── accesschecker_password_test.go │ │ │ │ ├── clicommand/ │ │ │ │ │ ├── errors.generated.go │ │ │ │ │ ├── generate_token_cli.go │ │ │ │ │ └── roundTripperReserseServerCli.go │ │ │ │ ├── config.pb.go │ │ │ │ ├── config.proto │ │ │ │ ├── errors.generated.go │ │ │ │ ├── reverser.go │ │ │ │ ├── reverserimpl.go │ │ │ │ └── reverserimpl_test.go │ │ │ └── stereotype/ │ │ │ ├── meek/ │ │ │ │ ├── config.pb.go │ │ │ │ ├── config.proto │ │ │ │ ├── errors.generated.go │ │ │ │ └── meek.go │ │ │ └── mekya/ │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── errors.generated.go │ │ │ └── mekya.go │ │ ├── security/ │ │ │ ├── connprop.go │ │ │ ├── errors.generated.go │ │ │ ├── security.go │ │ │ └── util.go │ │ ├── socket_activation_other.go │ │ ├── socket_activation_unix.go │ │ ├── sockopt.go │ │ ├── sockopt_darwin.go │ │ ├── sockopt_freebsd.go │ │ ├── sockopt_linux.go │ │ ├── sockopt_linux_test.go │ │ ├── sockopt_other.go │ │ ├── sockopt_test.go │ │ ├── sockopt_windows.go │ │ ├── system_dialer.go │ │ ├── system_dns_android.go │ │ ├── system_dns_android_test.go │ │ ├── system_listener.go │ │ ├── system_listener_test.go │ │ ├── tagged/ │ │ │ ├── tagged.go │ │ │ └── taggedimpl/ │ │ │ ├── errors.generated.go │ │ │ ├── impl.go │ │ │ └── taggedimpl.go │ │ ├── tcp/ │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── dialer.go │ │ │ ├── errors.generated.go │ │ │ ├── hub.go │ │ │ ├── sockopt_freebsd.go │ │ │ ├── sockopt_linux.go │ │ │ ├── sockopt_linux_test.go │ │ │ ├── sockopt_other.go │ │ │ └── tcp.go │ │ ├── tcp_hub.go │ │ ├── tls/ │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── config_other.go │ │ │ ├── config_test.go │ │ │ ├── config_windows.go │ │ │ ├── ech.go │ │ │ ├── ech_go122.go │ │ │ ├── engine.go │ │ │ ├── errors.generated.go │ │ │ ├── pin.go │ │ │ ├── pin_test.go │ │ │ ├── tls.go │ │ │ └── utls/ │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── errors.generated.go │ │ │ ├── nameMapper.go │ │ │ └── utls.go │ │ ├── tlsmirror/ │ │ │ ├── data.pb.go │ │ │ ├── data.proto │ │ │ ├── httponconnection/ │ │ │ │ ├── errors.generated.go │ │ │ │ └── singleconnhttp.go │ │ │ ├── interface.go │ │ │ ├── mirrorbase/ │ │ │ │ ├── base.go │ │ │ │ ├── conn.go │ │ │ │ ├── crypto.go │ │ │ │ ├── crypto_test.go │ │ │ │ └── errors.generated.go │ │ │ ├── mirrorcommon/ │ │ │ │ ├── handshake.go │ │ │ │ ├── loopback_protect.go │ │ │ │ ├── record.go │ │ │ │ ├── record_consts.go │ │ │ │ └── recordstream.go │ │ │ ├── mirrorcrypto/ │ │ │ │ ├── decryptor.go │ │ │ │ ├── derive_key.go │ │ │ │ ├── encrypter.go │ │ │ │ ├── errors.generated.go │ │ │ │ ├── mirrorcrypto.go │ │ │ │ ├── tls_cipher_suites.go │ │ │ │ └── tls_cipher_suites_linkname.go │ │ │ ├── mirrorenrollment/ │ │ │ │ ├── cancelContextOnCloseConn.go │ │ │ │ ├── clicommand/ │ │ │ │ │ └── enrollmentlink_cli.go │ │ │ │ ├── client.go │ │ │ │ ├── config.pb.go │ │ │ │ ├── config.proto │ │ │ │ ├── enrollment.go │ │ │ │ ├── enrollmentlink.go │ │ │ │ ├── enrollmentlink_test.go │ │ │ │ ├── errors.generated.go │ │ │ │ ├── httpenrollmentconfirmation/ │ │ │ │ │ ├── client.go │ │ │ │ │ ├── clientbuilder.go │ │ │ │ │ ├── enrollment.go │ │ │ │ │ ├── errors.generated.go │ │ │ │ │ ├── hub.go │ │ │ │ │ └── server.go │ │ │ │ ├── keyderivation.go │ │ │ │ ├── roundtripperenrollmentconfirmation/ │ │ │ │ │ ├── client.go │ │ │ │ │ ├── config.pb.go │ │ │ │ │ ├── config.proto │ │ │ │ │ ├── errors.generated.go │ │ │ │ │ ├── rttconfirmation.go │ │ │ │ │ ├── server.go │ │ │ │ │ └── serverinverserole.go │ │ │ │ ├── server.go │ │ │ │ └── serverenrollmentprocessor.go │ │ │ ├── server/ │ │ │ │ ├── ciphersuits_lookup.go │ │ │ │ ├── client.go │ │ │ │ ├── client_conn.go │ │ │ │ ├── config.pb.go │ │ │ │ ├── config.proto │ │ │ │ ├── conn.go │ │ │ │ ├── errors.generated.go │ │ │ │ ├── hub.go │ │ │ │ ├── outbound.go │ │ │ │ ├── padding.go │ │ │ │ └── server.go │ │ │ └── tlstrafficgen/ │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── errors.generated.go │ │ │ └── trafficgen.go │ │ ├── transportcommon/ │ │ │ ├── dialer.go │ │ │ ├── errors.generated.go │ │ │ ├── httpDialer.go │ │ │ ├── listener.go │ │ │ └── tansportcommon.go │ │ ├── udp/ │ │ │ ├── config.go │ │ │ ├── config.pb.go │ │ │ ├── config.proto │ │ │ ├── copy.go │ │ │ ├── dialer.go │ │ │ ├── dispatcher.go │ │ │ ├── dispatcher_packetaddr.go │ │ │ ├── dispatcher_split.go │ │ │ ├── dispatcher_split_test.go │ │ │ ├── errors.generated.go │ │ │ ├── hub.go │ │ │ ├── hub_freebsd.go │ │ │ ├── hub_linux.go │ │ │ ├── hub_other.go │ │ │ ├── monodest.go │ │ │ └── udp.go │ │ └── websocket/ │ │ ├── config.go │ │ ├── config.pb.go │ │ ├── config.proto │ │ ├── connection.go │ │ ├── connforwarder.go │ │ ├── dialer.go │ │ ├── errors.generated.go │ │ ├── hub.go │ │ ├── ws.go │ │ └── ws_test.go │ ├── link.go │ └── pipe/ │ ├── impl.go │ ├── pipe.go │ ├── pipe_test.go │ ├── reader.go │ └── writer.go ├── v2ray.go └── v2ray_test.go
Showing preview only (858K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (9480 symbols across 1123 files)
FILE: annotations.go
type Annotation (line 5) | type Annotation struct
FILE: app/browserforwarder/config.pb.go
constant _ (line 14) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 16) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type Config (line 20) | type Config struct
method Reset (line 28) | func (x *Config) Reset() {
method String (line 35) | func (x *Config) String() string {
method ProtoMessage (line 39) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 41) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 54) | func (*Config) Descriptor() ([]byte, []int) {
method GetListenAddr (line 58) | func (x *Config) GetListenAddr() string {
method GetListenPort (line 65) | func (x *Config) GetListenPort() int32 {
constant file_app_browserforwarder_config_proto_rawDesc (line 74) | file_app_browserforwarder_config_proto_rawDesc = "" +
function file_app_browserforwarder_config_proto_rawDescGZIP (line 90) | func file_app_browserforwarder_config_proto_rawDescGZIP() []byte {
function init (line 109) | func init() { file_app_browserforwarder_config_proto_init() }
function file_app_browserforwarder_config_proto_init (line 110) | func file_app_browserforwarder_config_proto_init() {
FILE: app/browserforwarder/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/browserforwarder/forwarder.go
type Forwarder (line 22) | type Forwarder struct
method ServeHTTP (line 31) | func (f *Forwarder) ServeHTTP(writer http.ResponseWriter, request *htt...
method DialWebsocket (line 44) | func (f *Forwarder) DialWebsocket(url string, header http.Header) (io....
method Type (line 65) | func (f *Forwarder) Type() interface{} {
method Start (line 69) | func (f *Forwarder) Start() error {
method Close (line 99) | func (f *Forwarder) Close() error {
function BridgeResource (line 106) | func BridgeResource(rw http.ResponseWriter, r *http.Request, path string) {
function NewForwarder (line 121) | func NewForwarder(ctx context.Context, cfg *Config) *Forwarder {
function init (line 125) | func init() {
FILE: app/commander/commander.go
type CommanderIfce (line 21) | type CommanderIfce interface
type Commander (line 28) | type Commander struct
method Type (line 66) | func (c *Commander) Type() interface{} {
method Start (line 71) | func (c *Commander) Start() error {
method Close (line 101) | func (c *Commander) Close() error {
method ExtractGrpcServer (line 115) | func (c *Commander) ExtractGrpcServer() *grpc.Server {
function NewCommander (line 37) | func NewCommander(ctx context.Context, config *Config) (*Commander, erro...
function init (line 121) | func init() {
function init (line 127) | func init() {
FILE: app/commander/config.pb.go
constant _ (line 15) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 17) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type Config (line 21) | type Config struct
method Reset (line 32) | func (x *Config) Reset() {
method String (line 39) | func (x *Config) String() string {
method ProtoMessage (line 43) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 45) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 58) | func (*Config) Descriptor() ([]byte, []int) {
method GetTag (line 62) | func (x *Config) GetTag() string {
method GetService (line 69) | func (x *Config) GetService() []*anypb.Any {
type ReflectionConfig (line 77) | type ReflectionConfig struct
method Reset (line 83) | func (x *ReflectionConfig) Reset() {
method String (line 90) | func (x *ReflectionConfig) String() string {
method ProtoMessage (line 94) | func (*ReflectionConfig) ProtoMessage() {}
method ProtoReflect (line 96) | func (x *ReflectionConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 109) | func (*ReflectionConfig) Descriptor() ([]byte, []int) {
type SimplifiedConfig (line 113) | type SimplifiedConfig struct
method Reset (line 121) | func (x *SimplifiedConfig) Reset() {
method String (line 128) | func (x *SimplifiedConfig) String() string {
method ProtoMessage (line 132) | func (*SimplifiedConfig) ProtoMessage() {}
method ProtoReflect (line 134) | func (x *SimplifiedConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 147) | func (*SimplifiedConfig) Descriptor() ([]byte, []int) {
method GetTag (line 151) | func (x *SimplifiedConfig) GetTag() string {
method GetName (line 158) | func (x *SimplifiedConfig) GetName() []string {
constant file_app_commander_config_proto_rawDesc (line 167) | file_app_commander_config_proto_rawDesc = "" +
function file_app_commander_config_proto_rawDescGZIP (line 187) | func file_app_commander_config_proto_rawDescGZIP() []byte {
function init (line 210) | func init() { file_app_commander_config_proto_init() }
function file_app_commander_config_proto_init (line 211) | func file_app_commander_config_proto_init() {
FILE: app/commander/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/commander/outbound.go
function NewOutboundListener (line 13) | func NewOutboundListener() *OutboundListener {
type OutboundListener (line 21) | type OutboundListener struct
method add (line 26) | func (l *OutboundListener) add(conn net.Conn) {
method Accept (line 37) | func (l *OutboundListener) Accept() (net.Conn, error) {
method Close (line 47) | func (l *OutboundListener) Close() error {
method Addr (line 62) | func (l *OutboundListener) Addr() net.Addr {
function NewOutbound (line 69) | func NewOutbound(tag string, listener *OutboundListener) *Outbound {
type Outbound (line 77) | type Outbound struct
method Dispatch (line 85) | func (co *Outbound) Dispatch(ctx context.Context, link *transport.Link) {
method Tag (line 103) | func (co *Outbound) Tag() string {
method Start (line 108) | func (co *Outbound) Start() error {
method Close (line 116) | func (co *Outbound) Close() error {
FILE: app/commander/service.go
type Service (line 13) | type Service interface
type reflectionService (line 18) | type reflectionService struct
method Register (line 20) | func (r reflectionService) Register(s *grpc.Server) {
function init (line 24) | func init() {
FILE: app/commander/webcommander/config.pb.go
constant _ (line 14) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 16) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type Config (line 19) | type Config struct
method Reset (line 29) | func (x *Config) Reset() {
method String (line 36) | func (x *Config) String() string {
method ProtoMessage (line 40) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 42) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 55) | func (*Config) Descriptor() ([]byte, []int) {
method GetTag (line 59) | func (x *Config) GetTag() string {
method GetWebRoot (line 66) | func (x *Config) GetWebRoot() []byte {
method GetWebRootFile (line 73) | func (x *Config) GetWebRootFile() string {
method GetApiMountpoint (line 80) | func (x *Config) GetApiMountpoint() string {
constant file_app_commander_webcommander_config_proto_rawDesc (line 89) | file_app_commander_webcommander_config_proto_rawDesc = "" +
function file_app_commander_webcommander_config_proto_rawDescGZIP (line 106) | func file_app_commander_webcommander_config_proto_rawDescGZIP() []byte {
function init (line 125) | func init() { file_app_commander_webcommander_config_proto_init() }
function file_app_commander_webcommander_config_proto_init (line 126) | func file_app_commander_webcommander_config_proto_init() {
FILE: app/commander/webcommander/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/commander/webcommander/webcommander.go
function newWebCommander (line 24) | func newWebCommander(ctx context.Context, config *Config) (*WebCommander...
type WebCommander (line 43) | type WebCommander struct
method ServeHTTP (line 57) | func (w *WebCommander) ServeHTTP(writer http.ResponseWriter, request *...
method asyncStart (line 73) | func (w *WebCommander) asyncStart() {
method Type (line 106) | func (w *WebCommander) Type() interface{} {
method Start (line 110) | func (w *WebCommander) Start() error {
method Close (line 126) | func (w *WebCommander) Close() error {
function init (line 141) | func init() {
FILE: app/dispatcher/config.pb.go
constant _ (line 13) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 15) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type SessionConfig (line 18) | type SessionConfig struct
method Reset (line 24) | func (x *SessionConfig) Reset() {
method String (line 31) | func (x *SessionConfig) String() string {
method ProtoMessage (line 35) | func (*SessionConfig) ProtoMessage() {}
method ProtoReflect (line 37) | func (x *SessionConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 50) | func (*SessionConfig) Descriptor() ([]byte, []int) {
type Config (line 54) | type Config struct
method Reset (line 61) | func (x *Config) Reset() {
method String (line 68) | func (x *Config) String() string {
method ProtoMessage (line 72) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 74) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 87) | func (*Config) Descriptor() ([]byte, []int) {
method GetSettings (line 91) | func (x *Config) GetSettings() *SessionConfig {
constant file_app_dispatcher_config_proto_rawDesc (line 100) | file_app_dispatcher_config_proto_rawDesc = "" +
function file_app_dispatcher_config_proto_rawDescGZIP (line 113) | func file_app_dispatcher_config_proto_rawDescGZIP() []byte {
function init (line 134) | func init() { file_app_dispatcher_config_proto_init() }
function file_app_dispatcher_config_proto_init (line 135) | func file_app_dispatcher_config_proto_init() {
FILE: app/dispatcher/default.go
type cachedReader (line 30) | type cachedReader struct
method Cache (line 36) | func (r *cachedReader) Cache(b *buf.Buffer, deadline time.Duration) er...
method readInternal (line 53) | func (r *cachedReader) readInternal() buf.MultiBuffer {
method ReadMultiBuffer (line 66) | func (r *cachedReader) ReadMultiBuffer() (buf.MultiBuffer, error) {
method ReadMultiBufferTimeout (line 75) | func (r *cachedReader) ReadMultiBufferTimeout(timeout time.Duration) (...
method Interrupt (line 84) | func (r *cachedReader) Interrupt() {
type DefaultDispatcher (line 94) | type DefaultDispatcher struct
method Init (line 114) | func (d *DefaultDispatcher) Init(config *Config, om outbound.Manager, ...
method Type (line 123) | func (*DefaultDispatcher) Type() interface{} {
method Start (line 128) | func (*DefaultDispatcher) Start() error {
method Close (line 133) | func (*DefaultDispatcher) Close() error { return nil }
method getLink (line 135) | func (d *DefaultDispatcher) getLink(ctx context.Context) (*transport.L...
method Dispatch (line 203) | func (d *DefaultDispatcher) Dispatch(ctx context.Context, destination ...
method routedDispatch (line 300) | func (d *DefaultDispatcher) routedDispatch(ctx context.Context, link *...
function init (line 101) | func init() {
function shouldOverride (line 181) | func shouldOverride(result SniffResult, domainOverride []string) bool {
function sniffer (line 245) | func sniffer(ctx context.Context, cReader *cachedReader, metadataOnly bo...
FILE: app/dispatcher/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/dispatcher/fakednssniffer.go
function newFakeDNSSniffer (line 18) | func newFakeDNSSniffer(ctx context.Context) (protocolSnifferWithMetadata...
type fakeDNSSniffResult (line 53) | type fakeDNSSniffResult struct
method Protocol (line 57) | func (fakeDNSSniffResult) Protocol() string {
method Domain (line 61) | func (f fakeDNSSniffResult) Domain() string {
type fakeDNSExtraOpts (line 65) | type fakeDNSExtraOpts
constant ipAddressInRange (line 67) | ipAddressInRange fakeDNSExtraOpts = 1
type ipAddressInRangeOpt (line 69) | type ipAddressInRangeOpt struct
type DNSThenOthersSniffResult (line 73) | type DNSThenOthersSniffResult struct
method IsProtoSubsetOf (line 78) | func (f DNSThenOthersSniffResult) IsProtoSubsetOf(protocolName string)...
method Protocol (line 82) | func (DNSThenOthersSniffResult) Protocol() string {
method Domain (line 86) | func (f DNSThenOthersSniffResult) Domain() string {
function newFakeDNSThenOthers (line 90) | func newFakeDNSThenOthers(ctx context.Context, fakeDNSSniffer protocolSn...
FILE: app/dispatcher/sniffer.go
type SniffResult (line 15) | type SniffResult interface
type protocolSniffer (line 20) | type protocolSniffer
type protocolSnifferWithMetadata (line 22) | type protocolSnifferWithMetadata struct
type Sniffer (line 31) | type Sniffer struct
method Sniff (line 58) | func (s *Sniffer) Sniff(c context.Context, payload []byte, network net...
method SniffMetadata (line 90) | func (s *Sniffer) SniffMetadata(c context.Context) (SniffResult, error) {
function NewSniffer (line 35) | func NewSniffer(ctx context.Context) *Sniffer {
function CompositeResult (line 117) | func CompositeResult(domainResult SniffResult, protocolResult SniffResul...
type compositeResult (line 121) | type compositeResult struct
method Protocol (line 126) | func (c compositeResult) Protocol() string {
method Domain (line 130) | func (c compositeResult) Domain() string {
method ProtocolForDomainResult (line 134) | func (c compositeResult) ProtocolForDomainResult() string {
type SnifferResultComposite (line 138) | type SnifferResultComposite interface
type SnifferIsProtoSubsetOf (line 142) | type SnifferIsProtoSubsetOf interface
FILE: app/dispatcher/stats.go
type SizeStatWriter (line 9) | type SizeStatWriter struct
method WriteMultiBuffer (line 14) | func (w *SizeStatWriter) WriteMultiBuffer(mb buf.MultiBuffer) error {
method Close (line 19) | func (w *SizeStatWriter) Close() error {
method Interrupt (line 23) | func (w *SizeStatWriter) Interrupt() {
FILE: app/dispatcher/stats_test.go
type TestCounter (line 11) | type TestCounter
method Value (line 13) | func (c *TestCounter) Value() int64 {
method Add (line 17) | func (c *TestCounter) Add(v int64) int64 {
method Set (line 23) | func (c *TestCounter) Set(v int64) int64 {
function TestStatsWriter (line 28) | func TestStatsWriter(t *testing.T) {
FILE: app/dns/config.go
function toStrMatcher (line 42) | func toStrMatcher(t DomainMatchingType, domain string) (strmatcher.Match...
function toNetIP (line 54) | func toNetIP(addrs []net.Address) ([]net.IP, error) {
function toIPOption (line 66) | func toIPOption(s QueryStrategy) dns.IPOption {
function toReqTypes (line 74) | func toReqTypes(option dns.IPOption) []dnsmessage.Type {
function generateRandomTag (line 85) | func generateRandomTag() string {
FILE: app/dns/config.pb.go
constant _ (line 17) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 19) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type DomainMatchingType (line 22) | type DomainMatchingType
method Enum (line 47) | func (x DomainMatchingType) Enum() *DomainMatchingType {
method String (line 53) | func (x DomainMatchingType) String() string {
method Descriptor (line 57) | func (DomainMatchingType) Descriptor() protoreflect.EnumDescriptor {
method Type (line 61) | func (DomainMatchingType) Type() protoreflect.EnumType {
method Number (line 65) | func (x DomainMatchingType) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 70) | func (DomainMatchingType) EnumDescriptor() ([]byte, []int) {
constant DomainMatchingType_Full (line 25) | DomainMatchingType_Full DomainMatchingType = 0
constant DomainMatchingType_Subdomain (line 26) | DomainMatchingType_Subdomain DomainMatchingType = 1
constant DomainMatchingType_Keyword (line 27) | DomainMatchingType_Keyword DomainMatchingType = 2
constant DomainMatchingType_Regex (line 28) | DomainMatchingType_Regex DomainMatchingType = 3
type QueryStrategy (line 74) | type QueryStrategy
method Enum (line 96) | func (x QueryStrategy) Enum() *QueryStrategy {
method String (line 102) | func (x QueryStrategy) String() string {
method Descriptor (line 106) | func (QueryStrategy) Descriptor() protoreflect.EnumDescriptor {
method Type (line 110) | func (QueryStrategy) Type() protoreflect.EnumType {
method Number (line 114) | func (x QueryStrategy) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 119) | func (QueryStrategy) EnumDescriptor() ([]byte, []int) {
constant QueryStrategy_USE_IP (line 77) | QueryStrategy_USE_IP QueryStrategy = 0
constant QueryStrategy_USE_IP4 (line 78) | QueryStrategy_USE_IP4 QueryStrategy = 1
constant QueryStrategy_USE_IP6 (line 79) | QueryStrategy_USE_IP6 QueryStrategy = 2
type CacheStrategy (line 123) | type CacheStrategy
method Enum (line 142) | func (x CacheStrategy) Enum() *CacheStrategy {
method String (line 148) | func (x CacheStrategy) String() string {
method Descriptor (line 152) | func (CacheStrategy) Descriptor() protoreflect.EnumDescriptor {
method Type (line 156) | func (CacheStrategy) Type() protoreflect.EnumType {
method Number (line 160) | func (x CacheStrategy) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 165) | func (CacheStrategy) EnumDescriptor() ([]byte, []int) {
constant CacheStrategy_CacheEnabled (line 126) | CacheStrategy_CacheEnabled CacheStrategy = 0
constant CacheStrategy_CacheDisabled (line 127) | CacheStrategy_CacheDisabled CacheStrategy = 1
type FallbackStrategy (line 169) | type FallbackStrategy
method Enum (line 191) | func (x FallbackStrategy) Enum() *FallbackStrategy {
method String (line 197) | func (x FallbackStrategy) String() string {
method Descriptor (line 201) | func (FallbackStrategy) Descriptor() protoreflect.EnumDescriptor {
method Type (line 205) | func (FallbackStrategy) Type() protoreflect.EnumType {
method Number (line 209) | func (x FallbackStrategy) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 214) | func (FallbackStrategy) EnumDescriptor() ([]byte, []int) {
constant FallbackStrategy_Enabled (line 172) | FallbackStrategy_Enabled FallbackStrategy = 0
constant FallbackStrategy_Disabled (line 173) | FallbackStrategy_Disabled FallbackStrategy = 1
constant FallbackStrategy_DisabledIfAnyMatch (line 174) | FallbackStrategy_DisabledIfAnyMatch FallbackStrategy = 2
type NameServer (line 218) | type NameServer struct
method Reset (line 238) | func (x *NameServer) Reset() {
method String (line 245) | func (x *NameServer) String() string {
method ProtoMessage (line 249) | func (*NameServer) ProtoMessage() {}
method ProtoReflect (line 251) | func (x *NameServer) ProtoReflect() protoreflect.Message {
method Descriptor (line 264) | func (*NameServer) Descriptor() ([]byte, []int) {
method GetAddress (line 268) | func (x *NameServer) GetAddress() *net.Endpoint {
method GetClientIp (line 275) | func (x *NameServer) GetClientIp() []byte {
method GetTag (line 282) | func (x *NameServer) GetTag() string {
method GetPrioritizedDomain (line 289) | func (x *NameServer) GetPrioritizedDomain() []*NameServer_PriorityDoma...
method GetGeoip (line 296) | func (x *NameServer) GetGeoip() []*routercommon.GeoIP {
method GetOriginalRules (line 303) | func (x *NameServer) GetOriginalRules() []*NameServer_OriginalRule {
method GetFakeDns (line 310) | func (x *NameServer) GetFakeDns() *fakedns.FakeDnsPoolMulti {
method GetSkipFallback (line 318) | func (x *NameServer) GetSkipFallback() bool {
method GetQueryStrategy (line 325) | func (x *NameServer) GetQueryStrategy() QueryStrategy {
method GetCacheStrategy (line 332) | func (x *NameServer) GetCacheStrategy() CacheStrategy {
method GetFallbackStrategy (line 339) | func (x *NameServer) GetFallbackStrategy() FallbackStrategy {
type HostMapping (line 346) | type HostMapping struct
method Reset (line 358) | func (x *HostMapping) Reset() {
method String (line 365) | func (x *HostMapping) String() string {
method ProtoMessage (line 369) | func (*HostMapping) ProtoMessage() {}
method ProtoReflect (line 371) | func (x *HostMapping) ProtoReflect() protoreflect.Message {
method Descriptor (line 384) | func (*HostMapping) Descriptor() ([]byte, []int) {
method GetType (line 388) | func (x *HostMapping) GetType() DomainMatchingType {
method GetDomain (line 395) | func (x *HostMapping) GetDomain() string {
method GetIp (line 402) | func (x *HostMapping) GetIp() [][]byte {
method GetProxiedDomain (line 409) | func (x *HostMapping) GetProxiedDomain() string {
type Config (line 416) | type Config struct
method Reset (line 465) | func (x *Config) Reset() {
method String (line 472) | func (x *Config) String() string {
method ProtoMessage (line 476) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 478) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 491) | func (*Config) Descriptor() ([]byte, []int) {
method GetNameServers (line 496) | func (x *Config) GetNameServers() []*net.Endpoint {
method GetNameServer (line 503) | func (x *Config) GetNameServer() []*NameServer {
method GetHosts (line 511) | func (x *Config) GetHosts() map[string]*net.IPOrDomain {
method GetClientIp (line 518) | func (x *Config) GetClientIp() []byte {
method GetStaticHosts (line 525) | func (x *Config) GetStaticHosts() []*HostMapping {
method GetFakeDns (line 532) | func (x *Config) GetFakeDns() *fakedns.FakeDnsPoolMulti {
method GetTag (line 539) | func (x *Config) GetTag() string {
method GetDomainMatcher (line 546) | func (x *Config) GetDomainMatcher() string {
method GetDisableCache (line 554) | func (x *Config) GetDisableCache() bool {
method GetDisableFallback (line 562) | func (x *Config) GetDisableFallback() bool {
method GetDisableFallbackIfMatch (line 570) | func (x *Config) GetDisableFallbackIfMatch() bool {
method GetQueryStrategy (line 577) | func (x *Config) GetQueryStrategy() QueryStrategy {
method GetCacheStrategy (line 584) | func (x *Config) GetCacheStrategy() CacheStrategy {
method GetFallbackStrategy (line 591) | func (x *Config) GetFallbackStrategy() FallbackStrategy {
type SimplifiedConfig (line 598) | type SimplifiedConfig struct
method Reset (line 636) | func (x *SimplifiedConfig) Reset() {
method String (line 643) | func (x *SimplifiedConfig) String() string {
method ProtoMessage (line 647) | func (*SimplifiedConfig) ProtoMessage() {}
method ProtoReflect (line 649) | func (x *SimplifiedConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 662) | func (*SimplifiedConfig) Descriptor() ([]byte, []int) {
method GetNameServer (line 666) | func (x *SimplifiedConfig) GetNameServer() []*SimplifiedNameServer {
method GetClientIp (line 673) | func (x *SimplifiedConfig) GetClientIp() string {
method GetStaticHosts (line 680) | func (x *SimplifiedConfig) GetStaticHosts() []*SimplifiedHostMapping {
method GetFakeDns (line 687) | func (x *SimplifiedConfig) GetFakeDns() *fakedns.FakeDnsPoolMulti {
method GetTag (line 694) | func (x *SimplifiedConfig) GetTag() string {
method GetDomainMatcher (line 701) | func (x *SimplifiedConfig) GetDomainMatcher() string {
method GetDisableCache (line 709) | func (x *SimplifiedConfig) GetDisableCache() bool {
method GetDisableFallback (line 717) | func (x *SimplifiedConfig) GetDisableFallback() bool {
method GetDisableFallbackIfMatch (line 725) | func (x *SimplifiedConfig) GetDisableFallbackIfMatch() bool {
method GetQueryStrategy (line 732) | func (x *SimplifiedConfig) GetQueryStrategy() QueryStrategy {
method GetCacheStrategy (line 739) | func (x *SimplifiedConfig) GetCacheStrategy() CacheStrategy {
method GetFallbackStrategy (line 746) | func (x *SimplifiedConfig) GetFallbackStrategy() FallbackStrategy {
type SimplifiedHostMapping (line 753) | type SimplifiedHostMapping struct
method Reset (line 765) | func (x *SimplifiedHostMapping) Reset() {
method String (line 772) | func (x *SimplifiedHostMapping) String() string {
method ProtoMessage (line 776) | func (*SimplifiedHostMapping) ProtoMessage() {}
method ProtoReflect (line 778) | func (x *SimplifiedHostMapping) ProtoReflect() protoreflect.Message {
method Descriptor (line 791) | func (*SimplifiedHostMapping) Descriptor() ([]byte, []int) {
method GetType (line 795) | func (x *SimplifiedHostMapping) GetType() DomainMatchingType {
method GetDomain (line 802) | func (x *SimplifiedHostMapping) GetDomain() string {
method GetIp (line 809) | func (x *SimplifiedHostMapping) GetIp() []string {
method GetProxiedDomain (line 816) | func (x *SimplifiedHostMapping) GetProxiedDomain() string {
type SimplifiedNameServer (line 823) | type SimplifiedNameServer struct
method Reset (line 844) | func (x *SimplifiedNameServer) Reset() {
method String (line 851) | func (x *SimplifiedNameServer) String() string {
method ProtoMessage (line 855) | func (*SimplifiedNameServer) ProtoMessage() {}
method ProtoReflect (line 857) | func (x *SimplifiedNameServer) ProtoReflect() protoreflect.Message {
method Descriptor (line 870) | func (*SimplifiedNameServer) Descriptor() ([]byte, []int) {
method GetAddress (line 874) | func (x *SimplifiedNameServer) GetAddress() *net.Endpoint {
method GetClientIp (line 881) | func (x *SimplifiedNameServer) GetClientIp() string {
method GetTag (line 888) | func (x *SimplifiedNameServer) GetTag() string {
method GetPrioritizedDomain (line 895) | func (x *SimplifiedNameServer) GetPrioritizedDomain() []*SimplifiedNam...
method GetGeoip (line 902) | func (x *SimplifiedNameServer) GetGeoip() []*routercommon.GeoIP {
method GetOriginalRules (line 909) | func (x *SimplifiedNameServer) GetOriginalRules() []*SimplifiedNameSer...
method GetFakeDns (line 916) | func (x *SimplifiedNameServer) GetFakeDns() *fakedns.FakeDnsPoolMulti {
method GetSkipFallback (line 924) | func (x *SimplifiedNameServer) GetSkipFallback() bool {
method GetQueryStrategy (line 931) | func (x *SimplifiedNameServer) GetQueryStrategy() QueryStrategy {
method GetCacheStrategy (line 938) | func (x *SimplifiedNameServer) GetCacheStrategy() CacheStrategy {
method GetFallbackStrategy (line 945) | func (x *SimplifiedNameServer) GetFallbackStrategy() FallbackStrategy {
method GetGeoDomain (line 952) | func (x *SimplifiedNameServer) GetGeoDomain() []*routercommon.GeoSite {
type NameServer_PriorityDomain (line 959) | type NameServer_PriorityDomain struct
method Reset (line 967) | func (x *NameServer_PriorityDomain) Reset() {
method String (line 974) | func (x *NameServer_PriorityDomain) String() string {
method ProtoMessage (line 978) | func (*NameServer_PriorityDomain) ProtoMessage() {}
method ProtoReflect (line 980) | func (x *NameServer_PriorityDomain) ProtoReflect() protoreflect.Message {
method Descriptor (line 993) | func (*NameServer_PriorityDomain) Descriptor() ([]byte, []int) {
method GetType (line 997) | func (x *NameServer_PriorityDomain) GetType() DomainMatchingType {
method GetDomain (line 1004) | func (x *NameServer_PriorityDomain) GetDomain() string {
type NameServer_OriginalRule (line 1011) | type NameServer_OriginalRule struct
method Reset (line 1019) | func (x *NameServer_OriginalRule) Reset() {
method String (line 1026) | func (x *NameServer_OriginalRule) String() string {
method ProtoMessage (line 1030) | func (*NameServer_OriginalRule) ProtoMessage() {}
method ProtoReflect (line 1032) | func (x *NameServer_OriginalRule) ProtoReflect() protoreflect.Message {
method Descriptor (line 1045) | func (*NameServer_OriginalRule) Descriptor() ([]byte, []int) {
method GetRule (line 1049) | func (x *NameServer_OriginalRule) GetRule() string {
method GetSize (line 1056) | func (x *NameServer_OriginalRule) GetSize() uint32 {
type SimplifiedNameServer_PriorityDomain (line 1063) | type SimplifiedNameServer_PriorityDomain struct
method Reset (line 1071) | func (x *SimplifiedNameServer_PriorityDomain) Reset() {
method String (line 1078) | func (x *SimplifiedNameServer_PriorityDomain) String() string {
method ProtoMessage (line 1082) | func (*SimplifiedNameServer_PriorityDomain) ProtoMessage() {}
method ProtoReflect (line 1084) | func (x *SimplifiedNameServer_PriorityDomain) ProtoReflect() protorefl...
method Descriptor (line 1097) | func (*SimplifiedNameServer_PriorityDomain) Descriptor() ([]byte, []in...
method GetType (line 1101) | func (x *SimplifiedNameServer_PriorityDomain) GetType() DomainMatching...
method GetDomain (line 1108) | func (x *SimplifiedNameServer_PriorityDomain) GetDomain() string {
type SimplifiedNameServer_OriginalRule (line 1115) | type SimplifiedNameServer_OriginalRule struct
method Reset (line 1123) | func (x *SimplifiedNameServer_OriginalRule) Reset() {
method String (line 1130) | func (x *SimplifiedNameServer_OriginalRule) String() string {
method ProtoMessage (line 1134) | func (*SimplifiedNameServer_OriginalRule) ProtoMessage() {}
method ProtoReflect (line 1136) | func (x *SimplifiedNameServer_OriginalRule) ProtoReflect() protoreflec...
method Descriptor (line 1149) | func (*SimplifiedNameServer_OriginalRule) Descriptor() ([]byte, []int) {
method GetRule (line 1153) | func (x *SimplifiedNameServer_OriginalRule) GetRule() string {
method GetSize (line 1160) | func (x *SimplifiedNameServer_OriginalRule) GetSize() uint32 {
constant file_app_dns_config_proto_rawDesc (line 1169) | file_app_dns_config_proto_rawDesc = "" +
function file_app_dns_config_proto_rawDescGZIP (line 1290) | func file_app_dns_config_proto_rawDescGZIP() []byte {
function init (line 1365) | func init() { file_app_dns_config_proto_init() }
function file_app_dns_config_proto_init (line 1366) | func file_app_dns_config_proto_init() {
FILE: app/dns/dns.go
type DNS (line 32) | type DNS struct
method Type (line 228) | func (*DNS) Type() interface{} {
method Start (line 233) | func (s *DNS) Start() error {
method Close (line 238) | func (s *DNS) Close() error {
method IsOwnLink (line 243) | func (s *DNS) IsOwnLink(ctx context.Context) bool {
method AsFakeDNSClient (line 249) | func (s *DNS) AsFakeDNSClient() dns.Client {
method AsFakeDNSEngine (line 254) | func (s *DNS) AsFakeDNSEngine() dns.FakeDNSEngine {
method LookupIP (line 259) | func (s *DNS) LookupIP(domain string) ([]net.IP, error) {
method LookupIPv4 (line 264) | func (s *DNS) LookupIPv4(domain string) ([]net.IP, error) {
method LookupIPv6 (line 269) | func (s *DNS) LookupIPv6(domain string) ([]net.IP, error) {
method lookupIPInternal (line 273) | func (s *DNS) lookupIPInternal(domain string, option dns.IPOption) ([]...
method sortClients (line 319) | func (s *DNS) sortClients(domain string, option dns.IPOption) []*Client {
method formatClientNames (line 370) | func (s *DNS) formatClientNames(clientIdxs []int, option dns.IPOption)...
type DomainMatcherInfo (line 44) | type DomainMatcherInfo struct
function New (line 50) | func New(ctx context.Context, config *Config) (*DNS, error) {
function establishDomainRules (line 108) | func establishDomainRules(s *DNS, config *Config, nsClientMap map[int]in...
function establishExpectedIPs (line 170) | func establishExpectedIPs(s *DNS, config *Config, nsClientMap map[int]in...
function establishFakeDNS (line 187) | func establishFakeDNS(s *DNS, config *Config, nsClientMap map[int]int) e...
function init (line 400) | func init() {
FILE: app/dns/dns_test.go
type staticHandler (line 27) | type staticHandler struct
method ServeDNS (line 29) | func (*staticHandler) ServeDNS(w dns.ResponseWriter, r *dns.Msg) {
function TestUDPServerSubnet (line 123) | func TestUDPServerSubnet(t *testing.T) {
function TestUDPServer (line 178) | func TestUDPServer(t *testing.T) {
function TestPrioritizedDomain (line 301) | func TestPrioritizedDomain(t *testing.T) {
function TestUDPServerIPv6 (line 383) | func TestUDPServerIPv6(t *testing.T) {
function TestStaticHostDomain (line 439) | func TestStaticHostDomain(t *testing.T) {
function TestIPMatch (line 504) | func TestIPMatch(t *testing.T) {
function TestLocalDomain (line 614) | func TestLocalDomain(t *testing.T) {
function TestMultiMatchPrioritizedDomain (line 810) | func TestMultiMatchPrioritizedDomain(t *testing.T) {
FILE: app/dns/dnscommon.go
function Fqdn (line 17) | func Fqdn(domain string) string {
type record (line 24) | type record struct
type IPRecord (line 30) | type IPRecord struct
method getIPs (line 37) | func (r *IPRecord) getIPs() ([]net.Address, error) {
function isNewer (line 47) | func isNewer(baseRec *IPRecord, newRec *IPRecord) bool {
type dnsRequest (line 59) | type dnsRequest struct
function genEDNS0Options (line 67) | func genEDNS0Options(clientIP net.IP) *dnsmessage.Resource {
function buildReqMsgs (line 115) | func buildReqMsgs(domain string, option dns_feature.IPOption, reqIDGen f...
function parseResponse (line 167) | func parseResponse(payload []byte) (*IPRecord, error) {
function filterIP (line 230) | func filterIP(ips []net.Address, option dns_feature.IPOption) []net.Addr...
FILE: app/dns/dnscommon_test.go
function Test_parseResponse (line 17) | func Test_parseResponse(t *testing.T) {
function Test_buildReqMsgs (line 99) | func Test_buildReqMsgs(t *testing.T) {
function Test_genEDNS0Options (line 143) | func Test_genEDNS0Options(t *testing.T) {
function TestFqdn (line 165) | func TestFqdn(t *testing.T) {
FILE: app/dns/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/dns/fakedns.go
type FakeDNSClient (line 13) | type FakeDNSClient struct
method LookupIP (line 18) | func (s *FakeDNSClient) LookupIP(domain string) ([]net.IP, error) {
method LookupIPv4 (line 23) | func (s *FakeDNSClient) LookupIPv4(domain string) ([]net.IP, error) {
method LookupIPv6 (line 28) | func (s *FakeDNSClient) LookupIPv6(domain string) ([]net.IP, error) {
type FakeDNSEngine (line 33) | type FakeDNSEngine struct
method Type (line 40) | func (*FakeDNSEngine) Type() interface{} {
method Start (line 45) | func (f *FakeDNSEngine) Start() error {
method Close (line 50) | func (f *FakeDNSEngine) Close() error {
method GetFakeIPForDomain (line 55) | func (f *FakeDNSEngine) GetFakeIPForDomain(domain string) []net.Address {
method GetDomainFromFakeDNS (line 60) | func (f *FakeDNSEngine) GetDomainFromFakeDNS(ip net.Address) string {
method IsIPInIPPool (line 65) | func (f *FakeDNSEngine) IsIPInIPPool(ip net.Address) bool {
method GetFakeIPForDomain3 (line 70) | func (f *FakeDNSEngine) GetFakeIPForDomain3(domain string, IPv4 bool, ...
FILE: app/dns/fakedns/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/dns/fakedns/fake.go
type Holder (line 19) | type Holder struct
method IsIPInIPPool (line 29) | func (fkdns *Holder) IsIPInIPPool(ip net.Address) bool {
method GetFakeIPForDomain3 (line 36) | func (fkdns *Holder) GetFakeIPForDomain3(domain string, ipv4, ipv6 boo...
method Type (line 44) | func (*Holder) Type() interface{} {
method Start (line 48) | func (fkdns *Holder) Start() error {
method Close (line 55) | func (fkdns *Holder) Close() error {
method initializeFromConfig (line 81) | func (fkdns *Holder) initializeFromConfig() error {
method initialize (line 85) | func (fkdns *Holder) initialize(ipPoolCidr string, lruSize int) error {
method GetFakeIPForDomain (line 113) | func (fkdns *Holder) GetFakeIPForDomain(domain string) []net.Address {
method GetDomainFromFakeDNS (line 138) | func (fkdns *Holder) GetDomainFromFakeDNS(ip net.Address) string {
function NewFakeDNSHolder (line 63) | func NewFakeDNSHolder() (*Holder, error) {
function NewFakeDNSHolderConfigOnly (line 77) | func NewFakeDNSHolderConfigOnly(conf *FakeDnsPool) (*Holder, error) {
type HolderMulti (line 148) | type HolderMulti struct
method IsIPInIPPool (line 152) | func (h *HolderMulti) IsIPInIPPool(ip net.Address) bool {
method GetFakeIPForDomain3 (line 164) | func (h *HolderMulti) GetFakeIPForDomain3(domain string, ipv4, ipv6 bo...
method GetFakeIPForDomain (line 172) | func (h *HolderMulti) GetFakeIPForDomain(domain string) []net.Address {
method GetDomainFromFakeDNS (line 180) | func (h *HolderMulti) GetDomainFromFakeDNS(ip net.Address) string {
method IsEmpty (line 189) | func (h *HolderMulti) IsEmpty() bool {
method AddPool (line 193) | func (h *HolderMulti) AddPool(poolConfig *FakeDnsPool) (*Holder, error) {
method AddPoolMulti (line 230) | func (h *HolderMulti) AddPoolMulti(poolMultiConfig *FakeDnsPoolMulti) ...
method Type (line 242) | func (h *HolderMulti) Type() interface{} {
method Start (line 246) | func (h *HolderMulti) Start() error {
method Close (line 255) | func (h *HolderMulti) Close() error {
method createHolderGroups (line 264) | func (h *HolderMulti) createHolderGroups(conf *FakeDnsPoolMulti) error {
function NewFakeDNSHolderMulti (line 274) | func NewFakeDNSHolderMulti(conf *FakeDnsPoolMulti) (*HolderMulti, error) {
function init (line 282) | func init() {
FILE: app/dns/fakedns/fakedns.pb.go
constant _ (line 14) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 16) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type FakeDnsPool (line 19) | type FakeDnsPool struct
method Reset (line 27) | func (x *FakeDnsPool) Reset() {
method String (line 34) | func (x *FakeDnsPool) String() string {
method ProtoMessage (line 38) | func (*FakeDnsPool) ProtoMessage() {}
method ProtoReflect (line 40) | func (x *FakeDnsPool) ProtoReflect() protoreflect.Message {
method Descriptor (line 53) | func (*FakeDnsPool) Descriptor() ([]byte, []int) {
method GetIpPool (line 57) | func (x *FakeDnsPool) GetIpPool() string {
method GetLruSize (line 64) | func (x *FakeDnsPool) GetLruSize() int64 {
type FakeDnsPoolMulti (line 71) | type FakeDnsPoolMulti struct
method Reset (line 78) | func (x *FakeDnsPoolMulti) Reset() {
method String (line 85) | func (x *FakeDnsPoolMulti) String() string {
method ProtoMessage (line 89) | func (*FakeDnsPoolMulti) ProtoMessage() {}
method ProtoReflect (line 91) | func (x *FakeDnsPoolMulti) ProtoReflect() protoreflect.Message {
method Descriptor (line 104) | func (*FakeDnsPoolMulti) Descriptor() ([]byte, []int) {
method GetPools (line 108) | func (x *FakeDnsPoolMulti) GetPools() []*FakeDnsPool {
constant file_app_dns_fakedns_fakedns_proto_rawDesc (line 117) | file_app_dns_fakedns_fakedns_proto_rawDesc = "" +
function file_app_dns_fakedns_fakedns_proto_rawDescGZIP (line 134) | func file_app_dns_fakedns_fakedns_proto_rawDescGZIP() []byte {
function init (line 155) | func init() { file_app_dns_fakedns_fakedns_proto_init() }
function file_app_dns_fakedns_fakedns_proto_init (line 156) | func file_app_dns_fakedns_fakedns_proto_init() {
FILE: app/dns/fakedns/fakedns_test.go
function TestNewFakeDnsHolder (line 16) | func TestNewFakeDnsHolder(_ *testing.T) {
function TestFakeDnsHolderCreateMapping (line 21) | func TestFakeDnsHolderCreateMapping(t *testing.T) {
function TestFakeDnsHolderCreateMappingMany (line 29) | func TestFakeDnsHolderCreateMappingMany(t *testing.T) {
function TestFakeDnsHolderCreateMappingManyAndResolve (line 40) | func TestFakeDnsHolderCreateMappingManyAndResolve(t *testing.T) {
function TestFakeDnsHolderCreateMappingManySingleDomain (line 65) | func TestFakeDnsHolderCreateMappingManySingleDomain(t *testing.T) {
function TestGetFakeIPForDomainConcurrently (line 76) | func TestGetFakeIPForDomainConcurrently(t *testing.T) {
function testGetFakeIP (line 94) | func testGetFakeIP(index int, addr [][]net.Address, fkdns *Holder) func(...
function TestFakeDnsHolderCreateMappingAndRollOver (line 101) | func TestFakeDnsHolderCreateMappingAndRollOver(t *testing.T) {
function TestFakeDNSMulti (line 145) | func TestFakeDNSMulti(t *testing.T) {
function TestFakeDNSMultiAddPool (line 221) | func TestFakeDNSMultiAddPool(t *testing.T) {
FILE: app/dns/fakedns_test.go
function TestFakeDNS (line 25) | func TestFakeDNS(t *testing.T) {
function TestFakeDNSEmptyGlobalConfig (line 176) | func TestFakeDNSEmptyGlobalConfig(t *testing.T) {
FILE: app/dns/hosts.go
type StaticHosts (line 12) | type StaticHosts struct
method lookupInternal (line 70) | func (h *StaticHosts) lookupInternal(domain string) []net.Address {
method lookup (line 78) | func (h *StaticHosts) lookup(domain string, option dns.IPOption, maxDe...
method Lookup (line 97) | func (h *StaticHosts) Lookup(domain string, option dns.IPOption) []net...
function NewStaticHosts (line 18) | func NewStaticHosts(hosts []*HostMapping, legacy map[string]*net.IPOrDom...
FILE: app/dns/hosts_test.go
function TestStaticHosts (line 14) | func TestStaticHosts(t *testing.T) {
FILE: app/dns/nameserver.go
type Server (line 21) | type Server interface
type Client (line 29) | type Client struct
method Name (line 177) | func (c *Client) Name() string {
method QueryIP (line 182) | func (c *Client) QueryIP(ctx context.Context, domain string, option dn...
method MatchExpectedIPs (line 206) | func (c *Client) MatchExpectedIPs(domain string, ips []net.IP) ([]net....
function NewServer (line 46) | func NewServer(ctx context.Context, dest net.Destination, onCreated func...
function NewClient (line 85) | func NewClient(ctx context.Context, ns *NameServer, dns *Config) (*Clien...
FILE: app/dns/nameserver_doh.go
type DoHNameServer (line 32) | type DoHNameServer struct
method Name (line 126) | func (s *DoHNameServer) Name() string {
method Cleanup (line 131) | func (s *DoHNameServer) Cleanup() error {
method updateIP (line 163) | func (s *DoHNameServer) updateIP(req *dnsRequest, ipRec *IPRecord) {
method newReqID (line 204) | func (s *DoHNameServer) newReqID() uint16 {
method sendQuery (line 208) | func (s *DoHNameServer) sendQuery(ctx context.Context, domain string, ...
method dohHTTPSContext (line 263) | func (s *DoHNameServer) dohHTTPSContext(ctx context.Context, b []byte)...
method findIPsForDomain (line 287) | func (s *DoHNameServer) findIPsForDomain(domain string, option dns_fea...
method QueryIP (line 326) | func (s *DoHNameServer) QueryIP(ctx context.Context, domain string, cl...
function NewDoHNameServer (line 43) | func NewDoHNameServer(url *url.URL, dispatcher routing.Dispatcher) (*DoH...
function NewDoHLocalNameServer (line 85) | func NewDoHLocalNameServer(url *url.URL) *DoHNameServer {
function baseDOHNameServer (line 111) | func baseDOHNameServer(url *url.URL, prefix string) *DoHNameServer {
FILE: app/dns/nameserver_doh_test.go
function TestDoHLocalNameServer (line 17) | func TestDoHLocalNameServer(t *testing.T) {
function TestDoHLocalNameServerWithCache (line 34) | func TestDoHLocalNameServerWithCache(t *testing.T) {
FILE: app/dns/nameserver_fakedns.go
type FakeDNSServer (line 14) | type FakeDNSServer struct
method Name (line 22) | func (FakeDNSServer) Name() string {
method QueryIP (line 26) | func (f *FakeDNSServer) QueryIP(ctx context.Context, domain string, _ ...
function NewFakeDNSServer (line 18) | func NewFakeDNSServer(fakeDNSEngine dns.FakeDNSEngine) *FakeDNSServer {
function isFakeDNS (line 57) | func isFakeDNS(server Server) bool {
FILE: app/dns/nameserver_local.go
type LocalNameServer (line 15) | type LocalNameServer struct
method QueryIP (line 20) | func (s *LocalNameServer) QueryIP(_ context.Context, domain string, _ ...
method Name (line 41) | func (s *LocalNameServer) Name() string {
function NewLocalNameServer (line 46) | func NewLocalNameServer() *LocalNameServer {
function NewLocalDNSClient (line 54) | func NewLocalDNSClient() *Client {
FILE: app/dns/nameserver_local_test.go
function TestLocalNameServer (line 14) | func TestLocalNameServer(t *testing.T) {
FILE: app/dns/nameserver_quic.go
constant NextProtoDQ (line 27) | NextProtoDQ = "doq"
constant handshakeIdleTimeout (line 29) | handshakeIdleTimeout = time.Second * 8
type QUICNameServer (line 32) | type QUICNameServer struct
method Name (line 71) | func (s *QUICNameServer) Name() string {
method Cleanup (line 76) | func (s *QUICNameServer) Cleanup() error {
method updateIP (line 108) | func (s *QUICNameServer) updateIP(req *dnsRequest, ipRec *IPRecord) {
method newReqID (line 149) | func (s *QUICNameServer) newReqID() uint16 {
method sendQuery (line 153) | func (s *QUICNameServer) sendQuery(ctx context.Context, domain string,...
method findIPsForDomain (line 240) | func (s *QUICNameServer) findIPsForDomain(domain string, option dns_fe...
method QueryIP (line 279) | func (s *QUICNameServer) QueryIP(ctx context.Context, domain string, c...
method getConnection (line 343) | func (s *QUICNameServer) getConnection(ctx context.Context) (*quic.Con...
method openConnection (line 377) | func (s *QUICNameServer) openConnection(ctx context.Context) (*quic.Co...
method openStream (line 402) | func (s *QUICNameServer) openStream(ctx context.Context) (*quic.Stream...
function NewQUICNameServer (line 43) | func NewQUICNameServer(url *url.URL) (*QUICNameServer, error) {
function isActive (line 334) | func isActive(s *quic.Conn) bool {
FILE: app/dns/nameserver_quic_test.go
function TestQUICNameServer (line 17) | func TestQUICNameServer(t *testing.T) {
function TestQUICNameServerWithCache (line 34) | func TestQUICNameServerWithCache(t *testing.T) {
FILE: app/dns/nameserver_tcp.go
type TCPNameServer (line 30) | type TCPNameServer struct
method Name (line 103) | func (s *TCPNameServer) Name() string {
method Cleanup (line 108) | func (s *TCPNameServer) Cleanup() error {
method updateIP (line 140) | func (s *TCPNameServer) updateIP(req *dnsRequest, ipRec *IPRecord) {
method newReqID (line 181) | func (s *TCPNameServer) newReqID() uint16 {
method sendQuery (line 185) | func (s *TCPNameServer) sendQuery(ctx context.Context, domain string, ...
method findIPsForDomain (line 269) | func (s *TCPNameServer) findIPsForDomain(domain string, option dns_fea...
method QueryIP (line 308) | func (s *TCPNameServer) QueryIP(ctx context.Context, domain string, cl...
function NewTCPNameServer (line 42) | func NewTCPNameServer(url *url.URL, dispatcher routing.Dispatcher) (*TCP...
function NewTCPLocalNameServer (line 64) | func NewTCPLocalNameServer(url *url.URL) (*TCPNameServer, error) {
function baseTCPNameServer (line 77) | func baseTCPNameServer(url *url.URL, prefix string) (*TCPNameServer, err...
FILE: app/dns/nameserver_tcp_test.go
function TestTCPLocalNameServer (line 17) | func TestTCPLocalNameServer(t *testing.T) {
function TestTCPLocalNameServerWithCache (line 34) | func TestTCPLocalNameServerWithCache(t *testing.T) {
FILE: app/dns/nameserver_udp.go
type ClassicNameServer (line 29) | type ClassicNameServer struct
method Name (line 65) | func (s *ClassicNameServer) Name() string {
method Cleanup (line 70) | func (s *ClassicNameServer) Cleanup() error {
method HandleResponse (line 112) | func (s *ClassicNameServer) HandleResponse(ctx context.Context, packet...
method updateIP (line 147) | func (s *ClassicNameServer) updateIP(domain string, newRec record) {
method newReqID (line 176) | func (s *ClassicNameServer) newReqID() uint16 {
method addPendingRequest (line 180) | func (s *ClassicNameServer) addPendingRequest(req *dnsRequest) {
method sendQuery (line 189) | func (s *ClassicNameServer) sendQuery(ctx context.Context, domain stri...
method findIPsForDomain (line 208) | func (s *ClassicNameServer) findIPsForDomain(domain string, option dns...
method QueryIP (line 247) | func (s *ClassicNameServer) QueryIP(ctx context.Context, domain string...
function NewClassicNameServer (line 42) | func NewClassicNameServer(address net.Destination, dispatcher routing.Di...
FILE: app/instman/command/command.go
type service (line 14) | type service struct
method ListInstance (line 20) | func (s service) ListInstance(ctx context.Context, req *ListInstanceRe...
method AddInstance (line 28) | func (s service) AddInstance(ctx context.Context, req *AddInstanceReq)...
method StartInstance (line 40) | func (s service) StartInstance(ctx context.Context, req *StartInstance...
method Register (line 48) | func (s service) Register(server *grpc.Server) {
function init (line 52) | func init() {
FILE: app/instman/command/command.pb.go
constant _ (line 14) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 16) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type ListInstanceReq (line 19) | type ListInstanceReq struct
method Reset (line 25) | func (x *ListInstanceReq) Reset() {
method String (line 32) | func (x *ListInstanceReq) String() string {
method ProtoMessage (line 36) | func (*ListInstanceReq) ProtoMessage() {}
method ProtoReflect (line 38) | func (x *ListInstanceReq) ProtoReflect() protoreflect.Message {
method Descriptor (line 51) | func (*ListInstanceReq) Descriptor() ([]byte, []int) {
type ListInstanceResp (line 55) | type ListInstanceResp struct
method Reset (line 62) | func (x *ListInstanceResp) Reset() {
method String (line 69) | func (x *ListInstanceResp) String() string {
method ProtoMessage (line 73) | func (*ListInstanceResp) ProtoMessage() {}
method ProtoReflect (line 75) | func (x *ListInstanceResp) ProtoReflect() protoreflect.Message {
method Descriptor (line 88) | func (*ListInstanceResp) Descriptor() ([]byte, []int) {
method GetName (line 92) | func (x *ListInstanceResp) GetName() []string {
type AddInstanceReq (line 99) | type AddInstanceReq struct
method Reset (line 108) | func (x *AddInstanceReq) Reset() {
method String (line 115) | func (x *AddInstanceReq) String() string {
method ProtoMessage (line 119) | func (*AddInstanceReq) ProtoMessage() {}
method ProtoReflect (line 121) | func (x *AddInstanceReq) ProtoReflect() protoreflect.Message {
method Descriptor (line 134) | func (*AddInstanceReq) Descriptor() ([]byte, []int) {
method GetName (line 138) | func (x *AddInstanceReq) GetName() string {
method GetConfigType (line 145) | func (x *AddInstanceReq) GetConfigType() string {
method GetConfigContentB64 (line 152) | func (x *AddInstanceReq) GetConfigContentB64() string {
type AddInstanceResp (line 159) | type AddInstanceResp struct
method Reset (line 165) | func (x *AddInstanceResp) Reset() {
method String (line 172) | func (x *AddInstanceResp) String() string {
method ProtoMessage (line 176) | func (*AddInstanceResp) ProtoMessage() {}
method ProtoReflect (line 178) | func (x *AddInstanceResp) ProtoReflect() protoreflect.Message {
method Descriptor (line 191) | func (*AddInstanceResp) Descriptor() ([]byte, []int) {
type StartInstanceReq (line 195) | type StartInstanceReq struct
method Reset (line 202) | func (x *StartInstanceReq) Reset() {
method String (line 209) | func (x *StartInstanceReq) String() string {
method ProtoMessage (line 213) | func (*StartInstanceReq) ProtoMessage() {}
method ProtoReflect (line 215) | func (x *StartInstanceReq) ProtoReflect() protoreflect.Message {
method Descriptor (line 228) | func (*StartInstanceReq) Descriptor() ([]byte, []int) {
method GetName (line 232) | func (x *StartInstanceReq) GetName() string {
type StartInstanceResp (line 239) | type StartInstanceResp struct
method Reset (line 245) | func (x *StartInstanceResp) Reset() {
method String (line 252) | func (x *StartInstanceResp) String() string {
method ProtoMessage (line 256) | func (*StartInstanceResp) ProtoMessage() {}
method ProtoReflect (line 258) | func (x *StartInstanceResp) ProtoReflect() protoreflect.Message {
method Descriptor (line 271) | func (*StartInstanceResp) Descriptor() ([]byte, []int) {
type Config (line 275) | type Config struct
method Reset (line 281) | func (x *Config) Reset() {
method String (line 288) | func (x *Config) String() string {
method ProtoMessage (line 292) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 294) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 307) | func (*Config) Descriptor() ([]byte, []int) {
constant file_app_instman_command_command_proto_rawDesc (line 313) | file_app_instman_command_command_proto_rawDesc = "" +
function file_app_instman_command_command_proto_rawDescGZIP (line 342) | func file_app_instman_command_command_proto_rawDescGZIP() []byte {
function init (line 373) | func init() { file_app_instman_command_command_proto_init() }
function file_app_instman_command_command_proto_init (line 374) | func file_app_instman_command_command_proto_init() {
FILE: app/instman/command/command_grpc.pb.go
constant _ (line 13) | _ = grpc.SupportPackageIsVersion9
constant InstanceManagementService_ListInstance_FullMethodName (line 16) | InstanceManagementService_ListInstance_FullMethodName = "/v2ray.core.ap...
constant InstanceManagementService_AddInstance_FullMethodName (line 17) | InstanceManagementService_AddInstance_FullMethodName = "/v2ray.core.ap...
constant InstanceManagementService_StartInstance_FullMethodName (line 18) | InstanceManagementService_StartInstance_FullMethodName = "/v2ray.core.ap...
type InstanceManagementServiceClient (line 24) | type InstanceManagementServiceClient interface
type instanceManagementServiceClient (line 30) | type instanceManagementServiceClient struct
method ListInstance (line 38) | func (c *instanceManagementServiceClient) ListInstance(ctx context.Con...
method AddInstance (line 48) | func (c *instanceManagementServiceClient) AddInstance(ctx context.Cont...
method StartInstance (line 58) | func (c *instanceManagementServiceClient) StartInstance(ctx context.Co...
function NewInstanceManagementServiceClient (line 34) | func NewInstanceManagementServiceClient(cc grpc.ClientConnInterface) Ins...
type InstanceManagementServiceServer (line 71) | type InstanceManagementServiceServer interface
type UnimplementedInstanceManagementServiceServer (line 83) | type UnimplementedInstanceManagementServiceServer struct
method ListInstance (line 85) | func (UnimplementedInstanceManagementServiceServer) ListInstance(conte...
method AddInstance (line 88) | func (UnimplementedInstanceManagementServiceServer) AddInstance(contex...
method StartInstance (line 91) | func (UnimplementedInstanceManagementServiceServer) StartInstance(cont...
method mustEmbedUnimplementedInstanceManagementServiceServer (line 94) | func (UnimplementedInstanceManagementServiceServer) mustEmbedUnimpleme...
method testEmbeddedByValue (line 96) | func (UnimplementedInstanceManagementServiceServer) testEmbeddedByValu...
type UnsafeInstanceManagementServiceServer (line 101) | type UnsafeInstanceManagementServiceServer interface
function RegisterInstanceManagementServiceServer (line 105) | func RegisterInstanceManagementServiceServer(s grpc.ServiceRegistrar, sr...
function _InstanceManagementService_ListInstance_Handler (line 116) | func _InstanceManagementService_ListInstance_Handler(srv interface{}, ct...
function _InstanceManagementService_AddInstance_Handler (line 134) | func _InstanceManagementService_AddInstance_Handler(srv interface{}, ctx...
function _InstanceManagementService_StartInstance_Handler (line 152) | func _InstanceManagementService_StartInstance_Handler(srv interface{}, c...
FILE: app/instman/config.pb.go
constant _ (line 14) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 16) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type Config (line 19) | type Config struct
method Reset (line 25) | func (x *Config) Reset() {
method String (line 32) | func (x *Config) String() string {
method ProtoMessage (line 36) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 38) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 51) | func (*Config) Descriptor() ([]byte, []int) {
constant file_app_instman_config_proto_rawDesc (line 57) | file_app_instman_config_proto_rawDesc = "" +
function file_app_instman_config_proto_rawDescGZIP (line 69) | func file_app_instman_config_proto_rawDescGZIP() []byte {
function init (line 88) | func init() { file_app_instman_config_proto_init() }
function file_app_instman_config_proto_init (line 89) | func file_app_instman_config_proto_init() {
FILE: app/instman/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/instman/instman.go
type InstanceMgr (line 13) | type InstanceMgr struct
method Type (line 18) | func (i InstanceMgr) Type() interface{} {
method Start (line 22) | func (i InstanceMgr) Start() error {
method Close (line 26) | func (i InstanceMgr) Close() error {
method ListInstance (line 30) | func (i InstanceMgr) ListInstance(ctx context.Context) ([]string, erro...
method AddInstance (line 38) | func (i InstanceMgr) AddInstance(ctx context.Context, name string, con...
method StartInstance (line 51) | func (i InstanceMgr) StartInstance(ctx context.Context, name string) e...
method StopInstance (line 59) | func (i InstanceMgr) StopInstance(ctx context.Context, name string) er...
method UntrackInstance (line 67) | func (i InstanceMgr) UntrackInstance(ctx context.Context, name string)...
function NewInstanceMgr (line 72) | func NewInstanceMgr(ctx context.Context, config *Config) (extension.Inst...
function init (line 76) | func init() {
FILE: app/log/command/command.go
type LoggerServer (line 17) | type LoggerServer struct
method RestartLogger (line 22) | func (s *LoggerServer) RestartLogger(ctx context.Context, request *Res...
method FollowLog (line 37) | func (s *LoggerServer) FollowLog(_ *FollowLogRequest, stream LoggerSer...
method mustEmbedUnimplementedLoggerServiceServer (line 62) | func (s *LoggerServer) mustEmbedUnimplementedLoggerServiceServer() {}
type service (line 64) | type service struct
method Register (line 68) | func (s *service) Register(server *grpc.Server) {
function init (line 74) | func init() {
FILE: app/log/command/command_test.go
function TestLoggerRestart (line 20) | func TestLoggerRestart(t *testing.T) {
FILE: app/log/command/config.pb.go
constant _ (line 13) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 15) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type Config (line 18) | type Config struct
method Reset (line 24) | func (x *Config) Reset() {
method String (line 31) | func (x *Config) String() string {
method ProtoMessage (line 35) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 37) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 50) | func (*Config) Descriptor() ([]byte, []int) {
type RestartLoggerRequest (line 54) | type RestartLoggerRequest struct
method Reset (line 60) | func (x *RestartLoggerRequest) Reset() {
method String (line 67) | func (x *RestartLoggerRequest) String() string {
method ProtoMessage (line 71) | func (*RestartLoggerRequest) ProtoMessage() {}
method ProtoReflect (line 73) | func (x *RestartLoggerRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 86) | func (*RestartLoggerRequest) Descriptor() ([]byte, []int) {
type RestartLoggerResponse (line 90) | type RestartLoggerResponse struct
method Reset (line 96) | func (x *RestartLoggerResponse) Reset() {
method String (line 103) | func (x *RestartLoggerResponse) String() string {
method ProtoMessage (line 107) | func (*RestartLoggerResponse) ProtoMessage() {}
method ProtoReflect (line 109) | func (x *RestartLoggerResponse) ProtoReflect() protoreflect.Message {
method Descriptor (line 122) | func (*RestartLoggerResponse) Descriptor() ([]byte, []int) {
type FollowLogRequest (line 126) | type FollowLogRequest struct
method Reset (line 132) | func (x *FollowLogRequest) Reset() {
method String (line 139) | func (x *FollowLogRequest) String() string {
method ProtoMessage (line 143) | func (*FollowLogRequest) ProtoMessage() {}
method ProtoReflect (line 145) | func (x *FollowLogRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 158) | func (*FollowLogRequest) Descriptor() ([]byte, []int) {
type FollowLogResponse (line 162) | type FollowLogResponse struct
method Reset (line 169) | func (x *FollowLogResponse) Reset() {
method String (line 176) | func (x *FollowLogResponse) String() string {
method ProtoMessage (line 180) | func (*FollowLogResponse) ProtoMessage() {}
method ProtoReflect (line 182) | func (x *FollowLogResponse) ProtoReflect() protoreflect.Message {
method Descriptor (line 195) | func (*FollowLogResponse) Descriptor() ([]byte, []int) {
method GetMessage (line 199) | func (x *FollowLogResponse) GetMessage() string {
constant file_app_log_command_config_proto_rawDesc (line 208) | file_app_log_command_config_proto_rawDesc = "" +
function file_app_log_command_config_proto_rawDescGZIP (line 227) | func file_app_log_command_config_proto_rawDescGZIP() []byte {
function init (line 254) | func init() { file_app_log_command_config_proto_init() }
function file_app_log_command_config_proto_init (line 255) | func file_app_log_command_config_proto_init() {
FILE: app/log/command/config_grpc.pb.go
constant _ (line 13) | _ = grpc.SupportPackageIsVersion9
constant LoggerService_RestartLogger_FullMethodName (line 16) | LoggerService_RestartLogger_FullMethodName = "/v2ray.core.app.log.comman...
constant LoggerService_FollowLog_FullMethodName (line 17) | LoggerService_FollowLog_FullMethodName = "/v2ray.core.app.log.comman...
type LoggerServiceClient (line 23) | type LoggerServiceClient interface
type loggerServiceClient (line 29) | type loggerServiceClient struct
method RestartLogger (line 37) | func (c *loggerServiceClient) RestartLogger(ctx context.Context, in *R...
method FollowLog (line 47) | func (c *loggerServiceClient) FollowLog(ctx context.Context, in *Follo...
function NewLoggerServiceClient (line 33) | func NewLoggerServiceClient(cc grpc.ClientConnInterface) LoggerServiceCl...
type LoggerServiceServer (line 69) | type LoggerServiceServer interface
type UnimplementedLoggerServiceServer (line 81) | type UnimplementedLoggerServiceServer struct
method RestartLogger (line 83) | func (UnimplementedLoggerServiceServer) RestartLogger(context.Context,...
method FollowLog (line 86) | func (UnimplementedLoggerServiceServer) FollowLog(*FollowLogRequest, g...
method mustEmbedUnimplementedLoggerServiceServer (line 89) | func (UnimplementedLoggerServiceServer) mustEmbedUnimplementedLoggerSe...
method testEmbeddedByValue (line 90) | func (UnimplementedLoggerServiceServer) testEmbeddedByValue() ...
type UnsafeLoggerServiceServer (line 95) | type UnsafeLoggerServiceServer interface
function RegisterLoggerServiceServer (line 99) | func RegisterLoggerServiceServer(s grpc.ServiceRegistrar, srv LoggerServ...
function _LoggerService_RestartLogger_Handler (line 110) | func _LoggerService_RestartLogger_Handler(srv interface{}, ctx context.C...
function _LoggerService_FollowLog_Handler (line 128) | func _LoggerService_FollowLog_Handler(srv interface{}, stream grpc.Serve...
FILE: app/log/command/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/log/config.pb.go
constant _ (line 15) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 17) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type LogType (line 20) | type LogType
method Enum (line 45) | func (x LogType) Enum() *LogType {
method String (line 51) | func (x LogType) String() string {
method Descriptor (line 55) | func (LogType) Descriptor() protoreflect.EnumDescriptor {
method Type (line 59) | func (LogType) Type() protoreflect.EnumType {
method Number (line 63) | func (x LogType) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 68) | func (LogType) EnumDescriptor() ([]byte, []int) {
constant LogType_None (line 23) | LogType_None LogType = 0
constant LogType_Console (line 24) | LogType_Console LogType = 1
constant LogType_File (line 25) | LogType_File LogType = 2
constant LogType_Event (line 26) | LogType_Event LogType = 3
type LogSpecification (line 72) | type LogSpecification struct
method Reset (line 81) | func (x *LogSpecification) Reset() {
method String (line 88) | func (x *LogSpecification) String() string {
method ProtoMessage (line 92) | func (*LogSpecification) ProtoMessage() {}
method ProtoReflect (line 94) | func (x *LogSpecification) ProtoReflect() protoreflect.Message {
method Descriptor (line 107) | func (*LogSpecification) Descriptor() ([]byte, []int) {
method GetType (line 111) | func (x *LogSpecification) GetType() LogType {
method GetLevel (line 118) | func (x *LogSpecification) GetLevel() log.Severity {
method GetPath (line 125) | func (x *LogSpecification) GetPath() string {
type Config (line 132) | type Config struct
method Reset (line 140) | func (x *Config) Reset() {
method String (line 147) | func (x *Config) String() string {
method ProtoMessage (line 151) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 153) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 166) | func (*Config) Descriptor() ([]byte, []int) {
method GetError (line 170) | func (x *Config) GetError() *LogSpecification {
method GetAccess (line 177) | func (x *Config) GetAccess() *LogSpecification {
constant file_app_log_config_proto_rawDesc (line 186) | file_app_log_config_proto_rawDesc = "" +
function file_app_log_config_proto_rawDescGZIP (line 209) | func file_app_log_config_proto_rawDescGZIP() []byte {
function init (line 236) | func init() { file_app_log_config_proto_init() }
function file_app_log_config_proto_init (line 237) | func file_app_log_config_proto_init() {
FILE: app/log/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/log/log.go
type Instance (line 15) | type Instance struct
method initAccessLogger (line 50) | func (g *Instance) initAccessLogger() error {
method initErrorLogger (line 61) | func (g *Instance) initErrorLogger() error {
method Type (line 73) | func (*Instance) Type() interface{} {
method startInternal (line 77) | func (g *Instance) startInternal() error {
method Start (line 98) | func (g *Instance) Start() error {
method AddFollower (line 103) | func (g *Instance) AddFollower(f func(msg log.Message)) {
method RemoveFollower (line 113) | func (g *Instance) RemoveFollower(f func(msg log.Message)) {
method Handle (line 120) | func (g *Instance) Handle(msg log.Message) {
method Close (line 147) | func (g *Instance) Close() error {
function New (line 25) | func New(ctx context.Context, config *Config) (*Instance, error) {
function init (line 168) | func init() {
FILE: app/log/log_creator.go
type HandlerCreatorOptions (line 8) | type HandlerCreatorOptions struct
type HandlerCreator (line 12) | type HandlerCreator
function RegisterHandlerCreator (line 16) | func RegisterHandlerCreator(logType LogType, f HandlerCreator) error {
function createHandler (line 25) | func createHandler(logType LogType, options HandlerCreatorOptions) (log....
function init (line 33) | func init() {
FILE: app/log/log_test.go
function TestCustomLogHandler (line 15) | func TestCustomLogHandler(t *testing.T) {
FILE: app/observatory/burst/burst.go
constant rttFailed (line 11) | rttFailed = time.Duration(math.MaxInt64 - iota)
constant rttUntested (line 12) | rttUntested
constant rttUnqualified (line 13) | rttUnqualified
FILE: app/observatory/burst/burstobserver.go
type Observer (line 17) | type Observer struct
method GetObservation (line 29) | func (o *Observer) GetObservation(ctx context.Context) (proto.Message,...
method createResult (line 33) | func (o *Observer) createResult() []*observatory.OutboundStatus {
method Type (line 59) | func (o *Observer) Type() interface{} {
method Start (line 63) | func (o *Observer) Start() error {
method Close (line 79) | func (o *Observer) Close() error {
function New (line 87) | func New(ctx context.Context, config *Config) (*Observer, error) {
function init (line 104) | func init() {
FILE: app/observatory/burst/config.pb.go
constant _ (line 14) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 16) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type Config (line 19) | type Config struct
method Reset (line 28) | func (x *Config) Reset() {
method String (line 35) | func (x *Config) String() string {
method ProtoMessage (line 39) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 41) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 54) | func (*Config) Descriptor() ([]byte, []int) {
method GetSubjectSelector (line 58) | func (x *Config) GetSubjectSelector() []string {
method GetPingConfig (line 65) | func (x *Config) GetPingConfig() *HealthPingConfig {
type HealthPingConfig (line 72) | type HealthPingConfig struct
method Reset (line 89) | func (x *HealthPingConfig) Reset() {
method String (line 96) | func (x *HealthPingConfig) String() string {
method ProtoMessage (line 100) | func (*HealthPingConfig) ProtoMessage() {}
method ProtoReflect (line 102) | func (x *HealthPingConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 115) | func (*HealthPingConfig) Descriptor() ([]byte, []int) {
method GetDestination (line 119) | func (x *HealthPingConfig) GetDestination() string {
method GetConnectivity (line 126) | func (x *HealthPingConfig) GetConnectivity() string {
method GetInterval (line 133) | func (x *HealthPingConfig) GetInterval() int64 {
method GetSamplingCount (line 140) | func (x *HealthPingConfig) GetSamplingCount() int32 {
method GetTimeout (line 147) | func (x *HealthPingConfig) GetTimeout() int64 {
constant file_app_observatory_burst_config_proto_rawDesc (line 156) | file_app_observatory_burst_config_proto_rawDesc = "" +
function file_app_observatory_burst_config_proto_rawDescGZIP (line 177) | func file_app_observatory_burst_config_proto_rawDescGZIP() []byte {
function init (line 198) | func init() { file_app_observatory_burst_config_proto_init() }
function file_app_observatory_burst_config_proto_init (line 199) | func file_app_observatory_burst_config_proto_init() {
FILE: app/observatory/burst/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/observatory/burst/healthping.go
type HealthPingSettings (line 14) | type HealthPingSettings struct
type HealthPing (line 23) | type HealthPing struct
method StartScheduler (line 73) | func (h *HealthPing) StartScheduler(selector func() ([]string, error)) {
method StopScheduler (line 104) | func (h *HealthPing) StopScheduler() {
method Check (line 115) | func (h *HealthPing) Check(tags []string) error {
method doCheck (line 131) | func (h *HealthPing) doCheck(tags []string, duration time.Duration, ro...
method PutResult (line 192) | func (h *HealthPing) PutResult(tag string, rtt time.Duration) {
method Cleanup (line 213) | func (h *HealthPing) Cleanup(tags []string) {
method checkConnectivity (line 232) | func (h *HealthPing) checkConnectivity() bool {
function NewHealthPing (line 34) | func NewHealthPing(ctx context.Context, config *HealthPingConfig) *Healt...
type rtt (line 124) | type rtt struct
FILE: app/observatory/burst/healthping_result.go
type HealthPingStats (line 9) | type HealthPingStats struct
type HealthPingRTTS (line 19) | type HealthPingRTTS struct
method Get (line 40) | func (h *HealthPingRTTS) Get() *HealthPingStats {
method GetWithCache (line 47) | func (h *HealthPingRTTS) GetWithCache() *HealthPingStats {
method Put (line 58) | func (h *HealthPingRTTS) Put(d time.Duration) {
method calcIndex (line 72) | func (h *HealthPingRTTS) calcIndex(step int) int {
method getStatistics (line 81) | func (h *HealthPingRTTS) getStatistics() *HealthPingStats {
method findOutdated (line 130) | func (h *HealthPingRTTS) findOutdated(now time.Time) int {
type pingRTT (line 29) | type pingRTT struct
function NewHealthPingResult (line 35) | func NewHealthPingResult(cap int, validity time.Duration) *HealthPingRTTS {
FILE: app/observatory/burst/healthping_result_test.go
function TestHealthPingResults (line 12) | func TestHealthPingResults(t *testing.T) {
function TestHealthPingResultsIgnoreOutdated (line 54) | func TestHealthPingResultsIgnoreOutdated(t *testing.T) {
FILE: app/observatory/burst/ping.go
type pingClient (line 12) | type pingClient struct
method MeasureDelay (line 53) | func (s *pingClient) MeasureDelay() (time.Duration, error) {
function newPingClient (line 17) | func newPingClient(ctx context.Context, destination string, timeout time...
function newDirectPingClient (line 24) | func newDirectPingClient(destination string, timeout time.Duration) *pin...
function newHTTPClient (line 31) | func newHTTPClient(ctxv context.Context, handler string, timeout time.Du...
FILE: app/observatory/command/command.go
type service (line 21) | type service struct
method GetOutboundStatus (line 28) | func (s *service) GetOutboundStatus(ctx context.Context, request *GetO...
method Register (line 56) | func (s *service) Register(server *grpc.Server) {
function init (line 60) | func init() {
FILE: app/observatory/command/command.pb.go
constant _ (line 15) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 17) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type GetOutboundStatusRequest (line 20) | type GetOutboundStatusRequest struct
method Reset (line 27) | func (x *GetOutboundStatusRequest) Reset() {
method String (line 34) | func (x *GetOutboundStatusRequest) String() string {
method ProtoMessage (line 38) | func (*GetOutboundStatusRequest) ProtoMessage() {}
method ProtoReflect (line 40) | func (x *GetOutboundStatusRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 53) | func (*GetOutboundStatusRequest) Descriptor() ([]byte, []int) {
method GetTag (line 57) | func (x *GetOutboundStatusRequest) GetTag() string {
type GetOutboundStatusResponse (line 64) | type GetOutboundStatusResponse struct
method Reset (line 71) | func (x *GetOutboundStatusResponse) Reset() {
method String (line 78) | func (x *GetOutboundStatusResponse) String() string {
method ProtoMessage (line 82) | func (*GetOutboundStatusResponse) ProtoMessage() {}
method ProtoReflect (line 84) | func (x *GetOutboundStatusResponse) ProtoReflect() protoreflect.Message {
method Descriptor (line 97) | func (*GetOutboundStatusResponse) Descriptor() ([]byte, []int) {
method GetStatus (line 101) | func (x *GetOutboundStatusResponse) GetStatus() *observatory.Observati...
type Config (line 108) | type Config struct
method Reset (line 114) | func (x *Config) Reset() {
method String (line 121) | func (x *Config) String() string {
method ProtoMessage (line 125) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 127) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 140) | func (*Config) Descriptor() ([]byte, []int) {
constant file_app_observatory_command_command_proto_rawDesc (line 146) | file_app_observatory_command_command_proto_rawDesc = "" +
function file_app_observatory_command_command_proto_rawDescGZIP (line 164) | func file_app_observatory_command_command_proto_rawDescGZIP() []byte {
function init (line 189) | func init() { file_app_observatory_command_command_proto_init() }
function file_app_observatory_command_command_proto_init (line 190) | func file_app_observatory_command_command_proto_init() {
FILE: app/observatory/command/command_grpc.pb.go
constant _ (line 13) | _ = grpc.SupportPackageIsVersion9
constant ObservatoryService_GetOutboundStatus_FullMethodName (line 16) | ObservatoryService_GetOutboundStatus_FullMethodName = "/v2ray.core.app.o...
type ObservatoryServiceClient (line 22) | type ObservatoryServiceClient interface
type observatoryServiceClient (line 26) | type observatoryServiceClient struct
method GetOutboundStatus (line 34) | func (c *observatoryServiceClient) GetOutboundStatus(ctx context.Conte...
function NewObservatoryServiceClient (line 30) | func NewObservatoryServiceClient(cc grpc.ClientConnInterface) Observator...
type ObservatoryServiceServer (line 47) | type ObservatoryServiceServer interface
type UnimplementedObservatoryServiceServer (line 57) | type UnimplementedObservatoryServiceServer struct
method GetOutboundStatus (line 59) | func (UnimplementedObservatoryServiceServer) GetOutboundStatus(context...
method mustEmbedUnimplementedObservatoryServiceServer (line 62) | func (UnimplementedObservatoryServiceServer) mustEmbedUnimplementedObs...
method testEmbeddedByValue (line 63) | func (UnimplementedObservatoryServiceServer) testEmbeddedByValue() ...
type UnsafeObservatoryServiceServer (line 68) | type UnsafeObservatoryServiceServer interface
function RegisterObservatoryServiceServer (line 72) | func RegisterObservatoryServiceServer(s grpc.ServiceRegistrar, srv Obser...
function _ObservatoryService_GetOutboundStatus_Handler (line 83) | func _ObservatoryService_GetOutboundStatus_Handler(srv interface{}, ctx ...
FILE: app/observatory/command/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/observatory/config.pb.go
constant _ (line 14) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 16) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type ObservationResult (line 19) | type ObservationResult struct
method Reset (line 26) | func (x *ObservationResult) Reset() {
method String (line 33) | func (x *ObservationResult) String() string {
method ProtoMessage (line 37) | func (*ObservationResult) ProtoMessage() {}
method ProtoReflect (line 39) | func (x *ObservationResult) ProtoReflect() protoreflect.Message {
method Descriptor (line 52) | func (*ObservationResult) Descriptor() ([]byte, []int) {
method GetStatus (line 56) | func (x *ObservationResult) GetStatus() []*OutboundStatus {
type HealthPingMeasurementResult (line 63) | type HealthPingMeasurementResult struct
method Reset (line 75) | func (x *HealthPingMeasurementResult) Reset() {
method String (line 82) | func (x *HealthPingMeasurementResult) String() string {
method ProtoMessage (line 86) | func (*HealthPingMeasurementResult) ProtoMessage() {}
method ProtoReflect (line 88) | func (x *HealthPingMeasurementResult) ProtoReflect() protoreflect.Mess...
method Descriptor (line 101) | func (*HealthPingMeasurementResult) Descriptor() ([]byte, []int) {
method GetAll (line 105) | func (x *HealthPingMeasurementResult) GetAll() int64 {
method GetFail (line 112) | func (x *HealthPingMeasurementResult) GetFail() int64 {
method GetDeviation (line 119) | func (x *HealthPingMeasurementResult) GetDeviation() int64 {
method GetAverage (line 126) | func (x *HealthPingMeasurementResult) GetAverage() int64 {
method GetMax (line 133) | func (x *HealthPingMeasurementResult) GetMax() int64 {
method GetMin (line 140) | func (x *HealthPingMeasurementResult) GetMin() int64 {
type OutboundStatus (line 147) | type OutboundStatus struct
method Reset (line 173) | func (x *OutboundStatus) Reset() {
method String (line 180) | func (x *OutboundStatus) String() string {
method ProtoMessage (line 184) | func (*OutboundStatus) ProtoMessage() {}
method ProtoReflect (line 186) | func (x *OutboundStatus) ProtoReflect() protoreflect.Message {
method Descriptor (line 199) | func (*OutboundStatus) Descriptor() ([]byte, []int) {
method GetAlive (line 203) | func (x *OutboundStatus) GetAlive() bool {
method GetDelay (line 210) | func (x *OutboundStatus) GetDelay() int64 {
method GetLastErrorReason (line 217) | func (x *OutboundStatus) GetLastErrorReason() string {
method GetOutboundTag (line 224) | func (x *OutboundStatus) GetOutboundTag() string {
method GetLastSeenTime (line 231) | func (x *OutboundStatus) GetLastSeenTime() int64 {
method GetLastTryTime (line 238) | func (x *OutboundStatus) GetLastTryTime() int64 {
method GetHealthPing (line 245) | func (x *OutboundStatus) GetHealthPing() *HealthPingMeasurementResult {
type ProbeResult (line 252) | type ProbeResult struct
method Reset (line 268) | func (x *ProbeResult) Reset() {
method String (line 275) | func (x *ProbeResult) String() string {
method ProtoMessage (line 279) | func (*ProbeResult) ProtoMessage() {}
method ProtoReflect (line 281) | func (x *ProbeResult) ProtoReflect() protoreflect.Message {
method Descriptor (line 294) | func (*ProbeResult) Descriptor() ([]byte, []int) {
method GetAlive (line 298) | func (x *ProbeResult) GetAlive() bool {
method GetDelay (line 305) | func (x *ProbeResult) GetDelay() int64 {
method GetLastErrorReason (line 312) | func (x *ProbeResult) GetLastErrorReason() string {
type Intensity (line 319) | type Intensity struct
method Reset (line 328) | func (x *Intensity) Reset() {
method String (line 335) | func (x *Intensity) String() string {
method ProtoMessage (line 339) | func (*Intensity) ProtoMessage() {}
method ProtoReflect (line 341) | func (x *Intensity) ProtoReflect() protoreflect.Message {
method Descriptor (line 354) | func (*Intensity) Descriptor() ([]byte, []int) {
method GetProbeInterval (line 358) | func (x *Intensity) GetProbeInterval() uint32 {
type Config (line 365) | type Config struct
method Reset (line 376) | func (x *Config) Reset() {
method String (line 383) | func (x *Config) String() string {
method ProtoMessage (line 387) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 389) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 402) | func (*Config) Descriptor() ([]byte, []int) {
method GetSubjectSelector (line 406) | func (x *Config) GetSubjectSelector() []string {
method GetProbeUrl (line 413) | func (x *Config) GetProbeUrl() string {
method GetProbeInterval (line 420) | func (x *Config) GetProbeInterval() int64 {
method GetPersistentProbeResult (line 427) | func (x *Config) GetPersistentProbeResult() bool {
constant file_app_observatory_config_proto_rawDesc (line 436) | file_app_observatory_config_proto_rawDesc = "" +
function file_app_observatory_config_proto_rawDescGZIP (line 476) | func file_app_observatory_config_proto_rawDescGZIP() []byte {
function init (line 502) | func init() { file_app_observatory_config_proto_init() }
function file_app_observatory_config_proto_init (line 503) | func file_app_observatory_config_proto_init() {
FILE: app/observatory/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/observatory/explainErrors.go
type errorCollector (line 5) | type errorCollector struct
method SubmitError (line 9) | func (e *errorCollector) SubmitError(err error) {
method UnderlyingError (line 21) | func (e *errorCollector) UnderlyingError() error {
function newErrorCollector (line 17) | func newErrorCollector() *errorCollector {
FILE: app/observatory/multiobservatory/config.pb.go
constant _ (line 15) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 17) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type Config (line 20) | type Config struct
method Reset (line 27) | func (x *Config) Reset() {
method String (line 34) | func (x *Config) String() string {
method ProtoMessage (line 38) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 40) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 53) | func (*Config) Descriptor() ([]byte, []int) {
method GetHolders (line 57) | func (x *Config) GetHolders() *taggedfeatures.Config {
constant file_app_observatory_multiobservatory_config_proto_rawDesc (line 66) | file_app_observatory_multiobservatory_config_proto_rawDesc = "" +
function file_app_observatory_multiobservatory_config_proto_rawDescGZIP (line 79) | func file_app_observatory_multiobservatory_config_proto_rawDescGZIP() []...
function init (line 100) | func init() { file_app_observatory_multiobservatory_config_proto_init() }
function file_app_observatory_multiobservatory_config_proto_init (line 101) | func file_app_observatory_multiobservatory_config_proto_init() {
FILE: app/observatory/multiobservatory/multi.go
type Observer (line 15) | type Observer struct
method GetObservation (line 21) | func (o Observer) GetObservation(ctx context.Context) (proto.Message, ...
method Type (line 25) | func (o Observer) Type() interface{} {
function New (line 29) | func New(ctx context.Context, config *Config) (*Observer, error) {
method UnmarshalJSONPB (line 37) | func (x *Config) UnmarshalJSONPB(unmarshaler *jsonpb.Unmarshaler, bytes ...
function init (line 43) | func init() {
FILE: app/observatory/observer.go
type Observer (line 33) | type Observer struct
method GetObservation (line 48) | func (o *Observer) GetObservation(ctx context.Context) (proto.Message,...
method Type (line 52) | func (o *Observer) Type() interface{} {
method Start (line 56) | func (o *Observer) Start() error {
method Close (line 82) | func (o *Observer) Close() error {
method background (line 89) | func (o *Observer) background() {
method updateStatus (line 126) | func (o *Observer) updateStatus(outbounds []string) {
method probe (line 133) | func (o *Observer) probe(outbound string) ProbeResult {
method updateStatusForResult (line 202) | func (o *Observer) updateStatusForResult(outbound string, result *Prob...
method findStatusLocationLockHolderOnly (line 232) | func (o *Observer) findStatusLocationLockHolderOnly(outbound string) i...
method loadOutboundStatus (line 241) | func (o *Observer) loadOutboundStatus(name string) {
function New (line 254) | func New(ctx context.Context, config *Config) (*Observer, error) {
function init (line 270) | func init() {
FILE: app/persistentstorage/filesystemstorage/config.pb.go
constant _ (line 14) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 16) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type StateStorageRoot (line 19) | type StateStorageRoot
method Enum (line 35) | func (x StateStorageRoot) Enum() *StateStorageRoot {
method String (line 41) | func (x StateStorageRoot) String() string {
method Descriptor (line 45) | func (StateStorageRoot) Descriptor() protoreflect.EnumDescriptor {
method Type (line 49) | func (StateStorageRoot) Type() protoreflect.EnumType {
method Number (line 53) | func (x StateStorageRoot) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 58) | func (StateStorageRoot) EnumDescriptor() ([]byte, []int) {
constant StateStorageRoot_WorkDir (line 22) | StateStorageRoot_WorkDir StateStorageRoot = 0
type Config (line 62) | type Config struct
method Reset (line 71) | func (x *Config) Reset() {
method String (line 78) | func (x *Config) String() string {
method ProtoMessage (line 82) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 84) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 97) | func (*Config) Descriptor() ([]byte, []int) {
method GetStateStorageRoot (line 101) | func (x *Config) GetStateStorageRoot() StateStorageRoot {
method GetInstanceName (line 108) | func (x *Config) GetInstanceName() string {
method GetProtojson (line 115) | func (x *Config) GetProtojson() bool {
constant file_app_persistentstorage_filesystemstorage_config_proto_rawDesc (line 124) | file_app_persistentstorage_filesystemstorage_config_proto_rawDesc = "" +
function file_app_persistentstorage_filesystemstorage_config_proto_rawDescGZIP (line 141) | func file_app_persistentstorage_filesystemstorage_config_proto_rawDescGZ...
function init (line 163) | func init() { file_app_persistentstorage_filesystemstorage_config_proto_...
function file_app_persistentstorage_filesystemstorage_config_proto_init (line 164) | func file_app_persistentstorage_filesystemstorage_config_proto_init() {
FILE: app/persistentstorage/filesystemstorage/fs.go
function newFileSystemStorage (line 19) | func newFileSystemStorage(ctx context.Context, config *Config) storage.S...
type fileSystemStorage (line 33) | type fileSystemStorage struct
method Type (line 42) | func (f *fileSystemStorage) Type() interface{} {
method Start (line 46) | func (f *fileSystemStorage) Start() error {
method Close (line 50) | func (f *fileSystemStorage) Close() error {
method PutProto (line 54) | func (f *fileSystemStorage) PutProto(ctx context.Context, key string, ...
method GetProto (line 58) | func (f *fileSystemStorage) GetProto(ctx context.Context, key string, ...
method ScopedPersistentStorageEngine (line 62) | func (f *fileSystemStorage) ScopedPersistentStorageEngine() {
method Put (line 65) | func (f *fileSystemStorage) Put(ctx context.Context, key []byte, value...
method Get (line 79) | func (f *fileSystemStorage) Get(ctx context.Context, key []byte) ([]by...
method List (line 89) | func (f *fileSystemStorage) List(ctx context.Context, keyPrefix []byte...
method Clear (line 103) | func (f *fileSystemStorage) Clear(ctx context.Context) {
method NarrowScope (line 113) | func (f *fileSystemStorage) NarrowScope(ctx context.Context, key []byt...
method DropScope (line 125) | func (f *fileSystemStorage) DropScope(ctx context.Context, key []byte)...
function init (line 129) | func init() {
FILE: app/persistentstorage/protostorage/protokv.go
type ProtoPersistentStorage (line 12) | type ProtoPersistentStorage interface
type protoStorage (line 17) | type protoStorage struct
method PutProto (line 22) | func (p *protoStorage) PutProto(ctx context.Context, key string, pb pr...
method GetProto (line 35) | func (p *protoStorage) GetProto(ctx context.Context, key string, pb pr...
function NewProtoStorage (line 46) | func NewProtoStorage(storage storage.ScopedPersistentStorage, textFormat...
FILE: app/policy/config.go
method Duration (line 10) | func (s *Second) Duration() time.Duration {
function defaultPolicy (line 17) | func defaultPolicy() *Policy {
method overrideWith (line 33) | func (p *Policy_Timeout) overrideWith(another *Policy_Timeout) {
method overrideWith (line 48) | func (p *Policy) overrideWith(another *Policy) {
method ToCorePolicy (line 64) | func (p *Policy) ToCorePolicy() policy.Session {
method ToCorePolicy (line 84) | func (p *SystemPolicy) ToCorePolicy() policy.System {
FILE: app/policy/config.pb.go
constant _ (line 14) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 16) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type Second (line 19) | type Second struct
method Reset (line 26) | func (x *Second) Reset() {
method String (line 33) | func (x *Second) String() string {
method ProtoMessage (line 37) | func (*Second) ProtoMessage() {}
method ProtoReflect (line 39) | func (x *Second) ProtoReflect() protoreflect.Message {
method Descriptor (line 52) | func (*Second) Descriptor() ([]byte, []int) {
method GetValue (line 56) | func (x *Second) GetValue() uint32 {
type Policy (line 63) | type Policy struct
method Reset (line 72) | func (x *Policy) Reset() {
method String (line 79) | func (x *Policy) String() string {
method ProtoMessage (line 83) | func (*Policy) ProtoMessage() {}
method ProtoReflect (line 85) | func (x *Policy) ProtoReflect() protoreflect.Message {
method Descriptor (line 98) | func (*Policy) Descriptor() ([]byte, []int) {
method GetTimeout (line 102) | func (x *Policy) GetTimeout() *Policy_Timeout {
method GetStats (line 109) | func (x *Policy) GetStats() *Policy_Stats {
method GetBuffer (line 116) | func (x *Policy) GetBuffer() *Policy_Buffer {
type SystemPolicy (line 123) | type SystemPolicy struct
method Reset (line 131) | func (x *SystemPolicy) Reset() {
method String (line 138) | func (x *SystemPolicy) String() string {
method ProtoMessage (line 142) | func (*SystemPolicy) ProtoMessage() {}
method ProtoReflect (line 144) | func (x *SystemPolicy) ProtoReflect() protoreflect.Message {
method Descriptor (line 157) | func (*SystemPolicy) Descriptor() ([]byte, []int) {
method GetStats (line 161) | func (x *SystemPolicy) GetStats() *SystemPolicy_Stats {
method GetOverrideAccessLogDest (line 168) | func (x *SystemPolicy) GetOverrideAccessLogDest() bool {
type Config (line 175) | type Config struct
method Reset (line 183) | func (x *Config) Reset() {
method String (line 190) | func (x *Config) String() string {
method ProtoMessage (line 194) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 196) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 209) | func (*Config) Descriptor() ([]byte, []int) {
method GetLevel (line 213) | func (x *Config) GetLevel() map[uint32]*Policy {
method GetSystem (line 220) | func (x *Config) GetSystem() *SystemPolicy {
type Policy_Timeout (line 228) | type Policy_Timeout struct
method Reset (line 238) | func (x *Policy_Timeout) Reset() {
method String (line 245) | func (x *Policy_Timeout) String() string {
method ProtoMessage (line 249) | func (*Policy_Timeout) ProtoMessage() {}
method ProtoReflect (line 251) | func (x *Policy_Timeout) ProtoReflect() protoreflect.Message {
method Descriptor (line 264) | func (*Policy_Timeout) Descriptor() ([]byte, []int) {
method GetHandshake (line 268) | func (x *Policy_Timeout) GetHandshake() *Second {
method GetConnectionIdle (line 275) | func (x *Policy_Timeout) GetConnectionIdle() *Second {
method GetUplinkOnly (line 282) | func (x *Policy_Timeout) GetUplinkOnly() *Second {
method GetDownlinkOnly (line 289) | func (x *Policy_Timeout) GetDownlinkOnly() *Second {
type Policy_Stats (line 296) | type Policy_Stats struct
method Reset (line 304) | func (x *Policy_Stats) Reset() {
method String (line 311) | func (x *Policy_Stats) String() string {
method ProtoMessage (line 315) | func (*Policy_Stats) ProtoMessage() {}
method ProtoReflect (line 317) | func (x *Policy_Stats) ProtoReflect() protoreflect.Message {
method Descriptor (line 330) | func (*Policy_Stats) Descriptor() ([]byte, []int) {
method GetUserUplink (line 334) | func (x *Policy_Stats) GetUserUplink() bool {
method GetUserDownlink (line 341) | func (x *Policy_Stats) GetUserDownlink() bool {
type Policy_Buffer (line 348) | type Policy_Buffer struct
method Reset (line 356) | func (x *Policy_Buffer) Reset() {
method String (line 363) | func (x *Policy_Buffer) String() string {
method ProtoMessage (line 367) | func (*Policy_Buffer) ProtoMessage() {}
method ProtoReflect (line 369) | func (x *Policy_Buffer) ProtoReflect() protoreflect.Message {
method Descriptor (line 382) | func (*Policy_Buffer) Descriptor() ([]byte, []int) {
method GetConnection (line 386) | func (x *Policy_Buffer) GetConnection() int32 {
type SystemPolicy_Stats (line 393) | type SystemPolicy_Stats struct
method Reset (line 403) | func (x *SystemPolicy_Stats) Reset() {
method String (line 410) | func (x *SystemPolicy_Stats) String() string {
method ProtoMessage (line 414) | func (*SystemPolicy_Stats) ProtoMessage() {}
method ProtoReflect (line 416) | func (x *SystemPolicy_Stats) ProtoReflect() protoreflect.Message {
method Descriptor (line 429) | func (*SystemPolicy_Stats) Descriptor() ([]byte, []int) {
method GetInboundUplink (line 433) | func (x *SystemPolicy_Stats) GetInboundUplink() bool {
method GetInboundDownlink (line 440) | func (x *SystemPolicy_Stats) GetInboundDownlink() bool {
method GetOutboundUplink (line 447) | func (x *SystemPolicy_Stats) GetOutboundUplink() bool {
method GetOutboundDownlink (line 454) | func (x *SystemPolicy_Stats) GetOutboundDownlink() bool {
constant file_app_policy_config_proto_rawDesc (line 463) | file_app_policy_config_proto_rawDesc = "" +
function file_app_policy_config_proto_rawDescGZIP (line 509) | func file_app_policy_config_proto_rawDescGZIP() []byte {
function init (line 547) | func init() { file_app_policy_config_proto_init() }
function file_app_policy_config_proto_init (line 548) | func file_app_policy_config_proto_init() {
FILE: app/policy/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/policy/manager.go
type Instance (line 11) | type Instance struct
method Type (line 34) | func (*Instance) Type() interface{} {
method ForLevel (line 39) | func (m *Instance) ForLevel(level uint32) policy.Session {
method ForSystem (line 47) | func (m *Instance) ForSystem() policy.System {
method Start (line 55) | func (m *Instance) Start() error {
method Close (line 60) | func (m *Instance) Close() error {
function New (line 17) | func New(ctx context.Context, config *Config) (*Instance, error) {
function init (line 64) | func init() {
FILE: app/policy/manager_test.go
function TestPolicy (line 13) | func TestPolicy(t *testing.T) {
FILE: app/proxyman/command/command.go
type InboundOperation (line 17) | type InboundOperation interface
type OutboundOperation (line 23) | type OutboundOperation interface
function getInbound (line 28) | func getInbound(handler inbound.Handler) (proxy.Inbound, error) {
method ApplyInbound (line 37) | func (op *AddUserOperation) ApplyInbound(ctx context.Context, handler in...
method ApplyInbound (line 54) | func (op *RemoveUserOperation) ApplyInbound(ctx context.Context, handler...
type handlerServer (line 66) | type handlerServer struct
method AddInbound (line 72) | func (s *handlerServer) AddInbound(ctx context.Context, request *AddIn...
method RemoveInbound (line 80) | func (s *handlerServer) RemoveInbound(ctx context.Context, request *Re...
method AlterInbound (line 84) | func (s *handlerServer) AlterInbound(ctx context.Context, request *Alt...
method AddOutbound (line 102) | func (s *handlerServer) AddOutbound(ctx context.Context, request *AddO...
method RemoveOutbound (line 109) | func (s *handlerServer) RemoveOutbound(ctx context.Context, request *R...
method AlterOutbound (line 113) | func (s *handlerServer) AlterOutbound(ctx context.Context, request *Al...
method mustEmbedUnimplementedHandlerServiceServer (line 127) | func (s *handlerServer) mustEmbedUnimplementedHandlerServiceServer() {}
type service (line 129) | type service struct
method Register (line 133) | func (s *service) Register(server *grpc.Server) {
function init (line 144) | func init() {
FILE: app/proxyman/command/command.pb.go
constant _ (line 17) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 19) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type AddUserOperation (line 22) | type AddUserOperation struct
method Reset (line 29) | func (x *AddUserOperation) Reset() {
method String (line 36) | func (x *AddUserOperation) String() string {
method ProtoMessage (line 40) | func (*AddUserOperation) ProtoMessage() {}
method ProtoReflect (line 42) | func (x *AddUserOperation) ProtoReflect() protoreflect.Message {
method Descriptor (line 55) | func (*AddUserOperation) Descriptor() ([]byte, []int) {
method GetUser (line 59) | func (x *AddUserOperation) GetUser() *protocol.User {
type RemoveUserOperation (line 66) | type RemoveUserOperation struct
method Reset (line 73) | func (x *RemoveUserOperation) Reset() {
method String (line 80) | func (x *RemoveUserOperation) String() string {
method ProtoMessage (line 84) | func (*RemoveUserOperation) ProtoMessage() {}
method ProtoReflect (line 86) | func (x *RemoveUserOperation) ProtoReflect() protoreflect.Message {
method Descriptor (line 99) | func (*RemoveUserOperation) Descriptor() ([]byte, []int) {
method GetEmail (line 103) | func (x *RemoveUserOperation) GetEmail() string {
type AddInboundRequest (line 110) | type AddInboundRequest struct
method Reset (line 117) | func (x *AddInboundRequest) Reset() {
method String (line 124) | func (x *AddInboundRequest) String() string {
method ProtoMessage (line 128) | func (*AddInboundRequest) ProtoMessage() {}
method ProtoReflect (line 130) | func (x *AddInboundRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 143) | func (*AddInboundRequest) Descriptor() ([]byte, []int) {
method GetInbound (line 147) | func (x *AddInboundRequest) GetInbound() *v5.InboundHandlerConfig {
type AddInboundResponse (line 154) | type AddInboundResponse struct
method Reset (line 160) | func (x *AddInboundResponse) Reset() {
method String (line 167) | func (x *AddInboundResponse) String() string {
method ProtoMessage (line 171) | func (*AddInboundResponse) ProtoMessage() {}
method ProtoReflect (line 173) | func (x *AddInboundResponse) ProtoReflect() protoreflect.Message {
method Descriptor (line 186) | func (*AddInboundResponse) Descriptor() ([]byte, []int) {
type RemoveInboundRequest (line 190) | type RemoveInboundRequest struct
method Reset (line 197) | func (x *RemoveInboundRequest) Reset() {
method String (line 204) | func (x *RemoveInboundRequest) String() string {
method ProtoMessage (line 208) | func (*RemoveInboundRequest) ProtoMessage() {}
method ProtoReflect (line 210) | func (x *RemoveInboundRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 223) | func (*RemoveInboundRequest) Descriptor() ([]byte, []int) {
method GetTag (line 227) | func (x *RemoveInboundRequest) GetTag() string {
type RemoveInboundResponse (line 234) | type RemoveInboundResponse struct
method Reset (line 240) | func (x *RemoveInboundResponse) Reset() {
method String (line 247) | func (x *RemoveInboundResponse) String() string {
method ProtoMessage (line 251) | func (*RemoveInboundResponse) ProtoMessage() {}
method ProtoReflect (line 253) | func (x *RemoveInboundResponse) ProtoReflect() protoreflect.Message {
method Descriptor (line 266) | func (*RemoveInboundResponse) Descriptor() ([]byte, []int) {
type AlterInboundRequest (line 270) | type AlterInboundRequest struct
method Reset (line 278) | func (x *AlterInboundRequest) Reset() {
method String (line 285) | func (x *AlterInboundRequest) String() string {
method ProtoMessage (line 289) | func (*AlterInboundRequest) ProtoMessage() {}
method ProtoReflect (line 291) | func (x *AlterInboundRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 304) | func (*AlterInboundRequest) Descriptor() ([]byte, []int) {
method GetTag (line 308) | func (x *AlterInboundRequest) GetTag() string {
method GetOperation (line 315) | func (x *AlterInboundRequest) GetOperation() *anypb.Any {
type AlterInboundResponse (line 322) | type AlterInboundResponse struct
method Reset (line 328) | func (x *AlterInboundResponse) Reset() {
method String (line 335) | func (x *AlterInboundResponse) String() string {
method ProtoMessage (line 339) | func (*AlterInboundResponse) ProtoMessage() {}
method ProtoReflect (line 341) | func (x *AlterInboundResponse) ProtoReflect() protoreflect.Message {
method Descriptor (line 354) | func (*AlterInboundResponse) Descriptor() ([]byte, []int) {
type AddOutboundRequest (line 358) | type AddOutboundRequest struct
method Reset (line 365) | func (x *AddOutboundRequest) Reset() {
method String (line 372) | func (x *AddOutboundRequest) String() string {
method ProtoMessage (line 376) | func (*AddOutboundRequest) ProtoMessage() {}
method ProtoReflect (line 378) | func (x *AddOutboundRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 391) | func (*AddOutboundRequest) Descriptor() ([]byte, []int) {
method GetOutbound (line 395) | func (x *AddOutboundRequest) GetOutbound() *v5.OutboundHandlerConfig {
type AddOutboundResponse (line 402) | type AddOutboundResponse struct
method Reset (line 408) | func (x *AddOutboundResponse) Reset() {
method String (line 415) | func (x *AddOutboundResponse) String() string {
method ProtoMessage (line 419) | func (*AddOutboundResponse) ProtoMessage() {}
method ProtoReflect (line 421) | func (x *AddOutboundResponse) ProtoReflect() protoreflect.Message {
method Descriptor (line 434) | func (*AddOutboundResponse) Descriptor() ([]byte, []int) {
type RemoveOutboundRequest (line 438) | type RemoveOutboundRequest struct
method Reset (line 445) | func (x *RemoveOutboundRequest) Reset() {
method String (line 452) | func (x *RemoveOutboundRequest) String() string {
method ProtoMessage (line 456) | func (*RemoveOutboundRequest) ProtoMessage() {}
method ProtoReflect (line 458) | func (x *RemoveOutboundRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 471) | func (*RemoveOutboundRequest) Descriptor() ([]byte, []int) {
method GetTag (line 475) | func (x *RemoveOutboundRequest) GetTag() string {
type RemoveOutboundResponse (line 482) | type RemoveOutboundResponse struct
method Reset (line 488) | func (x *RemoveOutboundResponse) Reset() {
method String (line 495) | func (x *RemoveOutboundResponse) String() string {
method ProtoMessage (line 499) | func (*RemoveOutboundResponse) ProtoMessage() {}
method ProtoReflect (line 501) | func (x *RemoveOutboundResponse) ProtoReflect() protoreflect.Message {
method Descriptor (line 514) | func (*RemoveOutboundResponse) Descriptor() ([]byte, []int) {
type AlterOutboundRequest (line 518) | type AlterOutboundRequest struct
method Reset (line 526) | func (x *AlterOutboundRequest) Reset() {
method String (line 533) | func (x *AlterOutboundRequest) String() string {
method ProtoMessage (line 537) | func (*AlterOutboundRequest) ProtoMessage() {}
method ProtoReflect (line 539) | func (x *AlterOutboundRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 552) | func (*AlterOutboundRequest) Descriptor() ([]byte, []int) {
method GetTag (line 556) | func (x *AlterOutboundRequest) GetTag() string {
method GetOperation (line 563) | func (x *AlterOutboundRequest) GetOperation() *anypb.Any {
type AlterOutboundResponse (line 570) | type AlterOutboundResponse struct
method Reset (line 576) | func (x *AlterOutboundResponse) Reset() {
method String (line 583) | func (x *AlterOutboundResponse) String() string {
method ProtoMessage (line 587) | func (*AlterOutboundResponse) ProtoMessage() {}
method ProtoReflect (line 589) | func (x *AlterOutboundResponse) ProtoReflect() protoreflect.Message {
method Descriptor (line 602) | func (*AlterOutboundResponse) Descriptor() ([]byte, []int) {
type Config (line 606) | type Config struct
method Reset (line 612) | func (x *Config) Reset() {
method String (line 619) | func (x *Config) String() string {
method ProtoMessage (line 623) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 625) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 638) | func (*Config) Descriptor() ([]byte, []int) {
constant file_app_proxyman_command_command_proto_rawDesc (line 644) | file_app_proxyman_command_command_proto_rawDesc = "" +
function file_app_proxyman_command_command_proto_rawDescGZIP (line 688) | func file_app_proxyman_command_command_proto_rawDescGZIP() []byte {
function init (line 742) | func init() { file_app_proxyman_command_command_proto_init() }
function file_app_proxyman_command_command_proto_init (line 743) | func file_app_proxyman_command_command_proto_init() {
FILE: app/proxyman/command/command_grpc.pb.go
constant _ (line 13) | _ = grpc.SupportPackageIsVersion9
constant HandlerService_AddInbound_FullMethodName (line 16) | HandlerService_AddInbound_FullMethodName = "/v2ray.core.app.proxyman...
constant HandlerService_RemoveInbound_FullMethodName (line 17) | HandlerService_RemoveInbound_FullMethodName = "/v2ray.core.app.proxyman...
constant HandlerService_AlterInbound_FullMethodName (line 18) | HandlerService_AlterInbound_FullMethodName = "/v2ray.core.app.proxyman...
constant HandlerService_AddOutbound_FullMethodName (line 19) | HandlerService_AddOutbound_FullMethodName = "/v2ray.core.app.proxyman...
constant HandlerService_RemoveOutbound_FullMethodName (line 20) | HandlerService_RemoveOutbound_FullMethodName = "/v2ray.core.app.proxyman...
constant HandlerService_AlterOutbound_FullMethodName (line 21) | HandlerService_AlterOutbound_FullMethodName = "/v2ray.core.app.proxyman...
type HandlerServiceClient (line 27) | type HandlerServiceClient interface
type handlerServiceClient (line 36) | type handlerServiceClient struct
method AddInbound (line 44) | func (c *handlerServiceClient) AddInbound(ctx context.Context, in *Add...
method RemoveInbound (line 54) | func (c *handlerServiceClient) RemoveInbound(ctx context.Context, in *...
method AlterInbound (line 64) | func (c *handlerServiceClient) AlterInbound(ctx context.Context, in *A...
method AddOutbound (line 74) | func (c *handlerServiceClient) AddOutbound(ctx context.Context, in *Ad...
method RemoveOutbound (line 84) | func (c *handlerServiceClient) RemoveOutbound(ctx context.Context, in ...
method AlterOutbound (line 94) | func (c *handlerServiceClient) AlterOutbound(ctx context.Context, in *...
function NewHandlerServiceClient (line 40) | func NewHandlerServiceClient(cc grpc.ClientConnInterface) HandlerService...
type HandlerServiceServer (line 107) | type HandlerServiceServer interface
type UnimplementedHandlerServiceServer (line 122) | type UnimplementedHandlerServiceServer struct
method AddInbound (line 124) | func (UnimplementedHandlerServiceServer) AddInbound(context.Context, *...
method RemoveInbound (line 127) | func (UnimplementedHandlerServiceServer) RemoveInbound(context.Context...
method AlterInbound (line 130) | func (UnimplementedHandlerServiceServer) AlterInbound(context.Context,...
method AddOutbound (line 133) | func (UnimplementedHandlerServiceServer) AddOutbound(context.Context, ...
method RemoveOutbound (line 136) | func (UnimplementedHandlerServiceServer) RemoveOutbound(context.Contex...
method AlterOutbound (line 139) | func (UnimplementedHandlerServiceServer) AlterOutbound(context.Context...
method mustEmbedUnimplementedHandlerServiceServer (line 142) | func (UnimplementedHandlerServiceServer) mustEmbedUnimplementedHandler...
method testEmbeddedByValue (line 143) | func (UnimplementedHandlerServiceServer) testEmbeddedByValue() ...
type UnsafeHandlerServiceServer (line 148) | type UnsafeHandlerServiceServer interface
function RegisterHandlerServiceServer (line 152) | func RegisterHandlerServiceServer(s grpc.ServiceRegistrar, srv HandlerSe...
function _HandlerService_AddInbound_Handler (line 163) | func _HandlerService_AddInbound_Handler(srv interface{}, ctx context.Con...
function _HandlerService_RemoveInbound_Handler (line 181) | func _HandlerService_RemoveInbound_Handler(srv interface{}, ctx context....
function _HandlerService_AlterInbound_Handler (line 199) | func _HandlerService_AlterInbound_Handler(srv interface{}, ctx context.C...
function _HandlerService_AddOutbound_Handler (line 217) | func _HandlerService_AddOutbound_Handler(srv interface{}, ctx context.Co...
function _HandlerService_RemoveOutbound_Handler (line 235) | func _HandlerService_RemoveOutbound_Handler(srv interface{}, ctx context...
function _HandlerService_AlterOutbound_Handler (line 253) | func _HandlerService_AlterOutbound_Handler(srv interface{}, ctx context....
FILE: app/proxyman/command/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/proxyman/config.go
method GetConcurrencyValue (line 3) | func (s *AllocationStrategy) GetConcurrencyValue() uint32 {
method GetRefreshValue (line 10) | func (s *AllocationStrategy) GetRefreshValue() uint32 {
method GetEffectiveSniffingSettings (line 17) | func (c *ReceiverConfig) GetEffectiveSniffingSettings() *SniffingConfig {
FILE: app/proxyman/config.pb.go
constant _ (line 16) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 18) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type KnownProtocols (line 21) | type KnownProtocols
method Enum (line 40) | func (x KnownProtocols) Enum() *KnownProtocols {
method String (line 46) | func (x KnownProtocols) String() string {
method Descriptor (line 50) | func (KnownProtocols) Descriptor() protoreflect.EnumDescriptor {
method Type (line 54) | func (KnownProtocols) Type() protoreflect.EnumType {
method Number (line 58) | func (x KnownProtocols) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 63) | func (KnownProtocols) EnumDescriptor() ([]byte, []int) {
constant KnownProtocols_HTTP (line 24) | KnownProtocols_HTTP KnownProtocols = 0
constant KnownProtocols_TLS (line 25) | KnownProtocols_TLS KnownProtocols = 1
type AllocationStrategy_Type (line 67) | type AllocationStrategy_Type
method Enum (line 92) | func (x AllocationStrategy_Type) Enum() *AllocationStrategy_Type {
method String (line 98) | func (x AllocationStrategy_Type) String() string {
method Descriptor (line 102) | func (AllocationStrategy_Type) Descriptor() protoreflect.EnumDescriptor {
method Type (line 106) | func (AllocationStrategy_Type) Type() protoreflect.EnumType {
method Number (line 110) | func (x AllocationStrategy_Type) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 115) | func (AllocationStrategy_Type) EnumDescriptor() ([]byte, []int) {
constant AllocationStrategy_Always (line 71) | AllocationStrategy_Always AllocationStrategy_Type = 0
constant AllocationStrategy_Random (line 73) | AllocationStrategy_Random AllocationStrategy_Type = 1
constant AllocationStrategy_External (line 75) | AllocationStrategy_External AllocationStrategy_Type = 2
type SenderConfig_DomainStrategy (line 119) | type SenderConfig_DomainStrategy
method Enum (line 144) | func (x SenderConfig_DomainStrategy) Enum() *SenderConfig_DomainStrate...
method String (line 150) | func (x SenderConfig_DomainStrategy) String() string {
method Descriptor (line 154) | func (SenderConfig_DomainStrategy) Descriptor() protoreflect.EnumDescr...
method Type (line 158) | func (SenderConfig_DomainStrategy) Type() protoreflect.EnumType {
method Number (line 162) | func (x SenderConfig_DomainStrategy) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 167) | func (SenderConfig_DomainStrategy) EnumDescriptor() ([]byte, []int) {
constant SenderConfig_AS_IS (line 122) | SenderConfig_AS_IS SenderConfig_DomainStrategy = 0
constant SenderConfig_USE_IP (line 123) | SenderConfig_USE_IP SenderConfig_DomainStrategy = 1
constant SenderConfig_USE_IP4 (line 124) | SenderConfig_USE_IP4 SenderConfig_DomainStrategy = 2
constant SenderConfig_USE_IP6 (line 125) | SenderConfig_USE_IP6 SenderConfig_DomainStrategy = 3
type InboundConfig (line 171) | type InboundConfig struct
method Reset (line 177) | func (x *InboundConfig) Reset() {
method String (line 184) | func (x *InboundConfig) String() string {
method ProtoMessage (line 188) | func (*InboundConfig) ProtoMessage() {}
method ProtoReflect (line 190) | func (x *InboundConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 203) | func (*InboundConfig) Descriptor() ([]byte, []int) {
type AllocationStrategy (line 207) | type AllocationStrategy struct
method Reset (line 220) | func (x *AllocationStrategy) Reset() {
method String (line 227) | func (x *AllocationStrategy) String() string {
method ProtoMessage (line 231) | func (*AllocationStrategy) ProtoMessage() {}
method ProtoReflect (line 233) | func (x *AllocationStrategy) ProtoReflect() protoreflect.Message {
method Descriptor (line 246) | func (*AllocationStrategy) Descriptor() ([]byte, []int) {
method GetType (line 250) | func (x *AllocationStrategy) GetType() AllocationStrategy_Type {
method GetConcurrency (line 257) | func (x *AllocationStrategy) GetConcurrency() *AllocationStrategy_Allo...
method GetRefresh (line 264) | func (x *AllocationStrategy) GetRefresh() *AllocationStrategy_Allocati...
type SniffingConfig (line 271) | type SniffingConfig struct
method Reset (line 285) | func (x *SniffingConfig) Reset() {
method String (line 292) | func (x *SniffingConfig) String() string {
method ProtoMessage (line 296) | func (*SniffingConfig) ProtoMessage() {}
method ProtoReflect (line 298) | func (x *SniffingConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 311) | func (*SniffingConfig) Descriptor() ([]byte, []int) {
method GetEnabled (line 315) | func (x *SniffingConfig) GetEnabled() bool {
method GetDestinationOverride (line 322) | func (x *SniffingConfig) GetDestinationOverride() []string {
method GetMetadataOnly (line 329) | func (x *SniffingConfig) GetMetadataOnly() bool {
type ReceiverConfig (line 336) | type ReceiverConfig struct
method Reset (line 355) | func (x *ReceiverConfig) Reset() {
method String (line 362) | func (x *ReceiverConfig) String() string {
method ProtoMessage (line 366) | func (*ReceiverConfig) ProtoMessage() {}
method ProtoReflect (line 368) | func (x *ReceiverConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 381) | func (*ReceiverConfig) Descriptor() ([]byte, []int) {
method GetPortRange (line 385) | func (x *ReceiverConfig) GetPortRange() *net.PortRange {
method GetListen (line 392) | func (x *ReceiverConfig) GetListen() *net.IPOrDomain {
method GetAllocationStrategy (line 399) | func (x *ReceiverConfig) GetAllocationStrategy() *AllocationStrategy {
method GetStreamSettings (line 406) | func (x *ReceiverConfig) GetStreamSettings() *internet.StreamConfig {
method GetReceiveOriginalDestination (line 413) | func (x *ReceiverConfig) GetReceiveOriginalDestination() bool {
method GetDomainOverride (line 421) | func (x *ReceiverConfig) GetDomainOverride() []KnownProtocols {
method GetSniffingSettings (line 428) | func (x *ReceiverConfig) GetSniffingSettings() *SniffingConfig {
type InboundHandlerConfig (line 435) | type InboundHandlerConfig struct
method Reset (line 444) | func (x *InboundHandlerConfig) Reset() {
method String (line 451) | func (x *InboundHandlerConfig) String() string {
method ProtoMessage (line 455) | func (*InboundHandlerConfig) ProtoMessage() {}
method ProtoReflect (line 457) | func (x *InboundHandlerConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 470) | func (*InboundHandlerConfig) Descriptor() ([]byte, []int) {
method GetTag (line 474) | func (x *InboundHandlerConfig) GetTag() string {
method GetReceiverSettings (line 481) | func (x *InboundHandlerConfig) GetReceiverSettings() *anypb.Any {
method GetProxySettings (line 488) | func (x *InboundHandlerConfig) GetProxySettings() *anypb.Any {
type OutboundConfig (line 495) | type OutboundConfig struct
method Reset (line 501) | func (x *OutboundConfig) Reset() {
method String (line 508) | func (x *OutboundConfig) String() string {
method ProtoMessage (line 512) | func (*OutboundConfig) ProtoMessage() {}
method ProtoReflect (line 514) | func (x *OutboundConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 527) | func (*OutboundConfig) Descriptor() ([]byte, []int) {
type SenderConfig (line 531) | type SenderConfig struct
method Reset (line 543) | func (x *SenderConfig) Reset() {
method String (line 550) | func (x *SenderConfig) String() string {
method ProtoMessage (line 554) | func (*SenderConfig) ProtoMessage() {}
method ProtoReflect (line 556) | func (x *SenderConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 569) | func (*SenderConfig) Descriptor() ([]byte, []int) {
method GetVia (line 573) | func (x *SenderConfig) GetVia() *net.IPOrDomain {
method GetStreamSettings (line 580) | func (x *SenderConfig) GetStreamSettings() *internet.StreamConfig {
method GetProxySettings (line 587) | func (x *SenderConfig) GetProxySettings() *internet.ProxyConfig {
method GetMultiplexSettings (line 594) | func (x *SenderConfig) GetMultiplexSettings() *MultiplexingConfig {
method GetDomainStrategy (line 601) | func (x *SenderConfig) GetDomainStrategy() SenderConfig_DomainStrategy {
type MultiplexingConfig (line 608) | type MultiplexingConfig struct
method Reset (line 618) | func (x *MultiplexingConfig) Reset() {
method String (line 625) | func (x *MultiplexingConfig) String() string {
method ProtoMessage (line 629) | func (*MultiplexingConfig) ProtoMessage() {}
method ProtoReflect (line 631) | func (x *MultiplexingConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 644) | func (*MultiplexingConfig) Descriptor() ([]byte, []int) {
method GetEnabled (line 648) | func (x *MultiplexingConfig) GetEnabled() bool {
method GetConcurrency (line 655) | func (x *MultiplexingConfig) GetConcurrency() uint32 {
type AllocationStrategy_AllocationStrategyConcurrency (line 662) | type AllocationStrategy_AllocationStrategyConcurrency struct
method Reset (line 669) | func (x *AllocationStrategy_AllocationStrategyConcurrency) Reset() {
method String (line 676) | func (x *AllocationStrategy_AllocationStrategyConcurrency) String() st...
method ProtoMessage (line 680) | func (*AllocationStrategy_AllocationStrategyConcurrency) ProtoMessage(...
method ProtoReflect (line 682) | func (x *AllocationStrategy_AllocationStrategyConcurrency) ProtoReflec...
method Descriptor (line 695) | func (*AllocationStrategy_AllocationStrategyConcurrency) Descriptor() ...
method GetValue (line 699) | func (x *AllocationStrategy_AllocationStrategyConcurrency) GetValue() ...
type AllocationStrategy_AllocationStrategyRefresh (line 706) | type AllocationStrategy_AllocationStrategyRefresh struct
method Reset (line 713) | func (x *AllocationStrategy_AllocationStrategyRefresh) Reset() {
method String (line 720) | func (x *AllocationStrategy_AllocationStrategyRefresh) String() string {
method ProtoMessage (line 724) | func (*AllocationStrategy_AllocationStrategyRefresh) ProtoMessage() {}
method ProtoReflect (line 726) | func (x *AllocationStrategy_AllocationStrategyRefresh) ProtoReflect() ...
method Descriptor (line 739) | func (*AllocationStrategy_AllocationStrategyRefresh) Descriptor() ([]b...
method GetValue (line 743) | func (x *AllocationStrategy_AllocationStrategyRefresh) GetValue() uint...
constant file_app_proxyman_config_proto_rawDesc (line 752) | file_app_proxyman_config_proto_rawDesc = "" +
function file_app_proxyman_config_proto_rawDescGZIP (line 813) | func file_app_proxyman_config_proto_rawDescGZIP() []byte {
function init (line 866) | func init() { file_app_proxyman_config_proto_init() }
function file_app_proxyman_config_proto_init (line 867) | func file_app_proxyman_config_proto_init() {
FILE: app/proxyman/inbound/always.go
function getStatCounter (line 19) | func getStatCounter(v *core.Instance, tag string) (stats.Counter, stats....
type AlwaysOnInboundHandler (line 44) | type AlwaysOnInboundHandler struct
method Start (line 151) | func (h *AlwaysOnInboundHandler) Start() error {
method Close (line 161) | func (h *AlwaysOnInboundHandler) Close() error {
method GetRandomInboundProxy (line 173) | func (h *AlwaysOnInboundHandler) GetRandomInboundProxy() (interface{},...
method Tag (line 181) | func (h *AlwaysOnInboundHandler) Tag() string {
method GetInbound (line 185) | func (h *AlwaysOnInboundHandler) GetInbound() proxy.Inbound {
function NewAlwaysOnInboundHandler (line 51) | func NewAlwaysOnInboundHandler(ctx context.Context, tag string, receiver...
FILE: app/proxyman/inbound/dynamic.go
type DynamicInboundHandler (line 18) | type DynamicInboundHandler struct
method allocatePort (line 71) | func (h *DynamicInboundHandler) allocatePort() net.Port {
method closeWorkers (line 89) | func (h *DynamicInboundHandler) closeWorkers(workers []worker) {
method refresh (line 105) | func (h *DynamicInboundHandler) refresh() error {
method Start (line 181) | func (h *DynamicInboundHandler) Start() error {
method Close (line 185) | func (h *DynamicInboundHandler) Close() error {
method GetRandomInboundProxy (line 189) | func (h *DynamicInboundHandler) GetRandomInboundProxy() (interface{}, ...
method Tag (line 201) | func (h *DynamicInboundHandler) Tag() string {
function NewDynamicInboundHandler (line 35) | func NewDynamicInboundHandler(ctx context.Context, tag string, receiverC...
FILE: app/proxyman/inbound/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/proxyman/inbound/inbound.go
type Manager (line 18) | type Manager struct
method Type (line 36) | func (*Manager) Type() interface{} {
method AddHandler (line 41) | func (m *Manager) AddHandler(ctx context.Context, handler inbound.Hand...
method GetHandler (line 60) | func (m *Manager) GetHandler(ctx context.Context, tag string) (inbound...
method RemoveHandler (line 72) | func (m *Manager) RemoveHandler(ctx context.Context, tag string) error {
method Start (line 92) | func (m *Manager) Start() error {
method Close (line 113) | func (m *Manager) Close() error {
function New (line 27) | func New(ctx context.Context, config *proxyman.InboundConfig) (*Manager,...
function NewHandler (line 139) | func NewHandler(ctx context.Context, config *core.InboundHandlerConfig) ...
function init (line 173) | func init() {
FILE: app/proxyman/inbound/worker.go
type worker (line 28) | type worker interface
type tcpWorker (line 35) | type tcpWorker struct
method callback (line 59) | func (w *tcpWorker) callback(conn internet.Connection) {
method Proxy (line 111) | func (w *tcpWorker) Proxy() proxy.Inbound {
method Start (line 115) | func (w *tcpWorker) Start() error {
method Close (line 133) | func (w *tcpWorker) Close() error {
method Port (line 150) | func (w *tcpWorker) Port() net.Port {
function getTProxyType (line 52) | func getTProxyType(s *internet.MemoryStreamConfig) internet.SocketConfig...
type udpConn (line 154) | type udpConn struct
method setInactive (line 167) | func (c *udpConn) setInactive() {
method updateActivity (line 171) | func (c *udpConn) updateActivity() {
method ReadMultiBuffer (line 176) | func (c *udpConn) ReadMultiBuffer() (buf.MultiBuffer, error) {
method Read (line 190) | func (c *udpConn) Read(buf []byte) (int, error) {
method Write (line 195) | func (c *udpConn) Write(buf []byte) (int, error) {
method Close (line 206) | func (c *udpConn) Close() error {
method RemoteAddr (line 212) | func (c *udpConn) RemoteAddr() net.Addr {
method LocalAddr (line 216) | func (c *udpConn) LocalAddr() net.Addr {
method SetDeadline (line 220) | func (*udpConn) SetDeadline(time.Time) error {
method SetReadDeadline (line 224) | func (*udpConn) SetReadDeadline(time.Time) error {
method SetWriteDeadline (line 228) | func (*udpConn) SetWriteDeadline(time.Time) error {
type connID (line 232) | type connID struct
type udpWorker (line 237) | type udpWorker struct
method getConnection (line 257) | func (w *udpWorker) getConnection(id connID) (*udpConn, bool) {
method callback (line 290) | func (w *udpWorker) callback(b *buf.Buffer, source net.Destination, or...
method removeConn (line 340) | func (w *udpWorker) removeConn(id connID) {
method handlePackets (line 346) | func (w *udpWorker) handlePackets() {
method clean (line 353) | func (w *udpWorker) clean() error {
method Start (line 379) | func (w *udpWorker) Start() error {
method Close (line 403) | func (w *udpWorker) Close() error {
method Port (line 431) | func (w *udpWorker) Port() net.Port {
method Proxy (line 435) | func (w *udpWorker) Proxy() proxy.Inbound {
type dsWorker (line 439) | type dsWorker struct
method callback (line 454) | func (w *dsWorker) callback(conn internet.Connection) {
method Proxy (line 487) | func (w *dsWorker) Proxy() proxy.Inbound {
method Port (line 491) | func (w *dsWorker) Port() net.Port {
method Start (line 495) | func (w *dsWorker) Start() error {
method Close (line 513) | func (w *dsWorker) Close() error {
FILE: app/proxyman/outbound/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/proxyman/outbound/handler.go
function getStatCounter (line 28) | func getStatCounter(v *core.Instance, tag string) (stats.Counter, stats....
type Handler (line 54) | type Handler struct
method Tag (line 148) | func (h *Handler) Tag() string {
method Dispatch (line 153) | func (h *Handler) Dispatch(ctx context.Context, link *transport.Link) {
method Address (line 188) | func (h *Handler) Address() net.Address {
method Dial (line 196) | func (h *Handler) Dial(ctx context.Context, dest net.Destination) (int...
method resolveIP (line 280) | func (h *Handler) resolveIP(ctx context.Context, domain string, localA...
method getStatCouterConnection (line 296) | func (h *Handler) getStatCouterConnection(conn internet.Connection) in...
method GetOutbound (line 308) | func (h *Handler) GetOutbound() proxy.Outbound {
method Start (line 313) | func (h *Handler) Start() error {
method Close (line 318) | func (h *Handler) Close() error {
function NewHandler (line 68) | func NewHandler(ctx context.Context, config *core.OutboundHandlerConfig)...
FILE: app/proxyman/outbound/handler_test.go
function TestInterfaces (line 27) | func TestInterfaces(t *testing.T) {
function toContext (line 33) | func toContext(ctx context.Context, v *core.Instance) context.Context
function TestOutboundWithoutStatCounter (line 35) | func TestOutboundWithoutStatCounter(t *testing.T) {
function TestOutboundWithStatCounter (line 71) | func TestOutboundWithStatCounter(t *testing.T) {
FILE: app/proxyman/outbound/outbound.go
type Manager (line 19) | type Manager struct
method Type (line 36) | func (m *Manager) Type() interface{} {
method Start (line 41) | func (m *Manager) Start() error {
method Close (line 63) | func (m *Manager) Close() error {
method GetDefaultHandler (line 82) | func (m *Manager) GetDefaultHandler() outbound.Handler {
method GetHandler (line 90) | func (m *Manager) GetHandler(tag string) outbound.Handler {
method AddHandler (line 100) | func (m *Manager) AddHandler(ctx context.Context, handler outbound.Han...
method RemoveHandler (line 128) | func (m *Manager) RemoveHandler(ctx context.Context, tag string) error {
method Select (line 150) | func (m *Manager) Select(selectors []string) []string {
function New (line 28) | func New(ctx context.Context, config *proxyman.OutboundConfig) (*Manager...
function init (line 172) | func init() {
FILE: app/restfulapi/config.go
function init (line 9) | func init() {
FILE: app/restfulapi/config.pb.go
constant _ (line 14) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 16) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type Config (line 19) | type Config struct
method Reset (line 28) | func (x *Config) Reset() {
method String (line 35) | func (x *Config) String() string {
method ProtoMessage (line 39) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 41) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 54) | func (*Config) Descriptor() ([]byte, []int) {
method GetListenAddr (line 58) | func (x *Config) GetListenAddr() string {
method GetListenPort (line 65) | func (x *Config) GetListenPort() int32 {
method GetAuthToken (line 72) | func (x *Config) GetAuthToken() string {
constant file_app_restfulapi_config_proto_rawDesc (line 81) | file_app_restfulapi_config_proto_rawDesc = "" +
function file_app_restfulapi_config_proto_rawDescGZIP (line 100) | func file_app_restfulapi_config_proto_rawDescGZIP() []byte {
function init (line 119) | func init() { file_app_restfulapi_config_proto_init() }
function file_app_restfulapi_config_proto_init (line 120) | func file_app_restfulapi_config_proto_init() {
FILE: app/restfulapi/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/restfulapi/restful_api.go
type StatsBound (line 19) | type StatsBound struct
method tagStats (line 24) | func (rs *restfulService) tagStats(w http.ResponseWriter, r *http.Reques...
method version (line 50) | func (rs *restfulService) version(w http.ResponseWriter, r *http.Request) {
method TokenAuthMiddleware (line 54) | func (rs *restfulService) TokenAuthMiddleware(next http.Handler) http.Ha...
method start (line 71) | func (rs *restfulService) start() error {
FILE: app/restfulapi/service.go
type restfulService (line 15) | type restfulService struct
method Type (line 25) | func (rs *restfulService) Type() interface{} {
method Start (line 29) | func (rs *restfulService) Start() error {
method Close (line 35) | func (rs *restfulService) Close() error {
method init (line 44) | func (rs *restfulService) init(config *Config, stats feature_stats.Man...
function newRestfulService (line 49) | func newRestfulService(ctx context.Context, config *Config) (features.Fe...
FILE: app/restfulapi/service_test.go
function TestTypeReturnAnonymousType (line 10) | func TestTypeReturnAnonymousType(t *testing.T) {
FILE: app/reverse/bridge.go
type Bridge (line 19) | type Bridge struct
method cleanup (line 50) | func (b *Bridge) cleanup() {
method monitor (line 64) | func (b *Bridge) monitor() error {
method Start (line 89) | func (b *Bridge) Start() error {
method Close (line 93) | func (b *Bridge) Close() error {
function NewBridge (line 29) | func NewBridge(ctx context.Context, config *BridgeConfig, dispatcher rou...
type BridgeWorker (line 97) | type BridgeWorker struct
method Type (line 131) | func (w *BridgeWorker) Type() interface{} {
method Start (line 135) | func (w *BridgeWorker) Start() error {
method Close (line 139) | func (w *BridgeWorker) Close() error {
method IsActive (line 143) | func (w *BridgeWorker) IsActive() bool {
method Connections (line 147) | func (w *BridgeWorker) Connections() uint32 {
method handleInternalConn (line 151) | func (w *BridgeWorker) handleInternalConn(link transport.Link) {
method Dispatch (line 173) | func (w *BridgeWorker) Dispatch(ctx context.Context, dest net.Destinat...
function NewBridgeWorker (line 104) | func NewBridgeWorker(ctx context.Context, domain string, tag string, d r...
FILE: app/reverse/config.go
method FillInRandom (line 10) | func (c *Control) FillInRandom() {
FILE: app/reverse/config.pb.go
constant _ (line 14) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 16) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type Control_State (line 19) | type Control_State
method Enum (line 38) | func (x Control_State) Enum() *Control_State {
method String (line 44) | func (x Control_State) String() string {
method Descriptor (line 48) | func (Control_State) Descriptor() protoreflect.EnumDescriptor {
method Type (line 52) | func (Control_State) Type() protoreflect.EnumType {
method Number (line 56) | func (x Control_State) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 61) | func (Control_State) EnumDescriptor() ([]byte, []int) {
constant Control_ACTIVE (line 22) | Control_ACTIVE Control_State = 0
constant Control_DRAIN (line 23) | Control_DRAIN Control_State = 1
type Control (line 65) | type Control struct
method Reset (line 73) | func (x *Control) Reset() {
method String (line 80) | func (x *Control) String() string {
method ProtoMessage (line 84) | func (*Control) ProtoMessage() {}
method ProtoReflect (line 86) | func (x *Control) ProtoReflect() protoreflect.Message {
method Descriptor (line 99) | func (*Control) Descriptor() ([]byte, []int) {
method GetState (line 103) | func (x *Control) GetState() Control_State {
method GetRandom (line 110) | func (x *Control) GetRandom() []byte {
type BridgeConfig (line 117) | type BridgeConfig struct
method Reset (line 125) | func (x *BridgeConfig) Reset() {
method String (line 132) | func (x *BridgeConfig) String() string {
method ProtoMessage (line 136) | func (*BridgeConfig) ProtoMessage() {}
method ProtoReflect (line 138) | func (x *BridgeConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 151) | func (*BridgeConfig) Descriptor() ([]byte, []int) {
method GetTag (line 155) | func (x *BridgeConfig) GetTag() string {
method GetDomain (line 162) | func (x *BridgeConfig) GetDomain() string {
type PortalConfig (line 169) | type PortalConfig struct
method Reset (line 177) | func (x *PortalConfig) Reset() {
method String (line 184) | func (x *PortalConfig) String() string {
method ProtoMessage (line 188) | func (*PortalConfig) ProtoMessage() {}
method ProtoReflect (line 190) | func (x *PortalConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 203) | func (*PortalConfig) Descriptor() ([]byte, []int) {
method GetTag (line 207) | func (x *PortalConfig) GetTag() string {
method GetDomain (line 214) | func (x *PortalConfig) GetDomain() string {
type Config (line 221) | type Config struct
method Reset (line 229) | func (x *Config) Reset() {
method String (line 236) | func (x *Config) String() string {
method ProtoMessage (line 240) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 242) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 255) | func (*Config) Descriptor() ([]byte, []int) {
method GetBridgeConfig (line 259) | func (x *Config) GetBridgeConfig() []*BridgeConfig {
method GetPortalConfig (line 266) | func (x *Config) GetPortalConfig() []*PortalConfig {
constant file_app_reverse_config_proto_rawDesc (line 275) | file_app_reverse_config_proto_rawDesc = "" +
function file_app_reverse_config_proto_rawDescGZIP (line 302) | func file_app_reverse_config_proto_rawDescGZIP() []byte {
function init (line 329) | func init() { file_app_reverse_config_proto_init() }
function file_app_reverse_config_proto_init (line 330) | func file_app_reverse_config_proto_init() {
FILE: app/reverse/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/reverse/portal.go
type Portal (line 21) | type Portal struct
method Start (line 56) | func (p *Portal) Start() error {
method Close (line 63) | func (p *Portal) Close() error {
method HandleConnection (line 67) | func (p *Portal) HandleConnection(ctx context.Context, link *transport...
function NewPortal (line 30) | func NewPortal(ctx context.Context, config *PortalConfig, ohm outbound.M...
type Outbound (line 91) | type Outbound struct
method Tag (line 96) | func (o *Outbound) Tag() string {
method Dispatch (line 100) | func (o *Outbound) Dispatch(ctx context.Context, link *transport.Link) {
method Start (line 107) | func (o *Outbound) Start() error {
method Close (line 111) | func (o *Outbound) Close() error {
type StaticMuxPicker (line 115) | type StaticMuxPicker struct
method cleanup (line 131) | func (p *StaticMuxPicker) cleanup() error {
method PickAvailable (line 149) | func (p *StaticMuxPicker) PickAvailable() (*mux.ClientWorker, error) {
method AddWorker (line 191) | func (p *StaticMuxPicker) AddWorker(worker *PortalWorker) {
function NewStaticMuxPicker (line 121) | func NewStaticMuxPicker() (*StaticMuxPicker, error) {
type PortalWorker (line 198) | type PortalWorker struct
method heartbeat (line 234) | func (w *PortalWorker) heartbeat() error {
method IsFull (line 263) | func (w *PortalWorker) IsFull() bool {
method Closed (line 267) | func (w *PortalWorker) Closed() bool {
function NewPortalWorker (line 206) | func NewPortalWorker(ctx context.Context, client *mux.ClientWorker) (*Po...
FILE: app/reverse/portal_test.go
function TestStaticPickerEmpty (line 10) | func TestStaticPickerEmpty(t *testing.T) {
FILE: app/reverse/reverse.go
constant internalDomain (line 17) | internalDomain = "reverse.internal.v2fly.org"
function isDomain (line 20) | func isDomain(dest net.Destination, domain string) bool {
function isInternalDomain (line 24) | func isInternalDomain(dest net.Destination) bool {
function init (line 28) | func init() {
type Reverse (line 40) | type Reverse struct
method Init (line 45) | func (r *Reverse) Init(ctx context.Context, config *Config, d routing....
method Type (line 65) | func (r *Reverse) Type() interface{} {
method Start (line 69) | func (r *Reverse) Start() error {
method Close (line 85) | func (r *Reverse) Close() error {
FILE: app/router/balancing.go
type BalancingStrategy (line 13) | type BalancingStrategy interface
type BalancingPrincipleTarget (line 17) | type BalancingPrincipleTarget interface
type Balancer (line 21) | type Balancer struct
method PickOutbound (line 31) | func (b *Balancer) PickOutbound() (string, error) {
method InjectContext (line 57) | func (b *Balancer) InjectContext(ctx context.Context) {
method SelectOutbounds (line 64) | func (b *Balancer) SelectOutbounds() ([]string, error) {
method GetPrincipleTarget (line 74) | func (r *Router) GetPrincipleTarget(tag string) ([]string, error) {
method SetOverrideTarget (line 89) | func (r *Router) SetOverrideTarget(tag, target string) error {
method GetOverrideTarget (line 98) | func (r *Router) GetOverrideTarget(tag string) (string, error) {
FILE: app/router/balancing_override.go
method OverrideBalancer (line 7) | func (r *Router) OverrideBalancer(balancer string, target string) error {
type overrideSettings (line 22) | type overrideSettings struct
type override (line 26) | type override struct
method Get (line 32) | func (o *override) Get() string {
method Put (line 39) | func (o *override) Put(target string) {
method Clear (line 46) | func (o *override) Clear() {
FILE: app/router/command/command.go
type routingServer (line 18) | type routingServer struct
method GetBalancerInfo (line 23) | func (s *routingServer) GetBalancerInfo(ctx context.Context, request *...
method OverrideBalancerTarget (line 51) | func (s *routingServer) OverrideBalancerTarget(ctx context.Context, re...
method TestRoute (line 66) | func (s *routingServer) TestRoute(ctx context.Context, request *TestRo...
method SubscribeRoutingStats (line 81) | func (s *routingServer) SubscribeRoutingStats(request *SubscribeRoutin...
method mustEmbedUnimplementedRoutingServiceServer (line 111) | func (s *routingServer) mustEmbedUnimplementedRoutingServiceServer() {}
function NewRoutingServer (line 59) | func NewRoutingServer(router routing.Router, routingStats stats.Channel)...
type service (line 113) | type service struct
method Register (line 117) | func (s *service) Register(server *grpc.Server) {
function init (line 123) | func init() {
FILE: app/router/command/command.pb.go
constant _ (line 15) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 17) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type RoutingContext (line 23) | type RoutingContext struct
method Reset (line 41) | func (x *RoutingContext) Reset() {
method String (line 48) | func (x *RoutingContext) String() string {
method ProtoMessage (line 52) | func (*RoutingContext) ProtoMessage() {}
method ProtoReflect (line 54) | func (x *RoutingContext) ProtoReflect() protoreflect.Message {
method Descriptor (line 67) | func (*RoutingContext) Descriptor() ([]byte, []int) {
method GetInboundTag (line 71) | func (x *RoutingContext) GetInboundTag() string {
method GetNetwork (line 78) | func (x *RoutingContext) GetNetwork() net.Network {
method GetSourceIPs (line 85) | func (x *RoutingContext) GetSourceIPs() [][]byte {
method GetTargetIPs (line 92) | func (x *RoutingContext) GetTargetIPs() [][]byte {
method GetSourcePort (line 99) | func (x *RoutingContext) GetSourcePort() uint32 {
method GetTargetPort (line 106) | func (x *RoutingContext) GetTargetPort() uint32 {
method GetTargetDomain (line 113) | func (x *RoutingContext) GetTargetDomain() string {
method GetProtocol (line 120) | func (x *RoutingContext) GetProtocol() string {
method GetUser (line 127) | func (x *RoutingContext) GetUser() string {
method GetAttributes (line 134) | func (x *RoutingContext) GetAttributes() map[string]string {
method GetOutboundGroupTags (line 141) | func (x *RoutingContext) GetOutboundGroupTags() []string {
method GetOutboundTag (line 148) | func (x *RoutingContext) GetOutboundTag() string {
type SubscribeRoutingStatsRequest (line 173) | type SubscribeRoutingStatsRequest struct
method Reset (line 180) | func (x *SubscribeRoutingStatsRequest) Reset() {
method String (line 187) | func (x *SubscribeRoutingStatsRequest) String() string {
method ProtoMessage (line 191) | func (*SubscribeRoutingStatsRequest) ProtoMessage() {}
method ProtoReflect (line 193) | func (x *SubscribeRoutingStatsRequest) ProtoReflect() protoreflect.Mes...
method Descriptor (line 206) | func (*SubscribeRoutingStatsRequest) Descriptor() ([]byte, []int) {
method GetFieldSelectors (line 210) | func (x *SubscribeRoutingStatsRequest) GetFieldSelectors() []string {
type TestRouteRequest (line 224) | type TestRouteRequest struct
method Reset (line 233) | func (x *TestRouteRequest) Reset() {
method String (line 240) | func (x *TestRouteRequest) String() string {
method ProtoMessage (line 244) | func (*TestRouteRequest) ProtoMessage() {}
method ProtoReflect (line 246) | func (x *TestRouteRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 259) | func (*TestRouteRequest) Descriptor() ([]byte, []int) {
method GetRoutingContext (line 263) | func (x *TestRouteRequest) GetRoutingContext() *RoutingContext {
method GetFieldSelectors (line 270) | func (x *TestRouteRequest) GetFieldSelectors() []string {
method GetPublishResult (line 277) | func (x *TestRouteRequest) GetPublishResult() bool {
type PrincipleTargetInfo (line 284) | type PrincipleTargetInfo struct
method Reset (line 291) | func (x *PrincipleTargetInfo) Reset() {
method String (line 298) | func (x *PrincipleTargetInfo) String() string {
method ProtoMessage (line 302) | func (*PrincipleTargetInfo) ProtoMessage() {}
method ProtoReflect (line 304) | func (x *PrincipleTargetInfo) ProtoReflect() protoreflect.Message {
method Descriptor (line 317) | func (*PrincipleTargetInfo) Descriptor() ([]byte, []int) {
method GetTag (line 321) | func (x *PrincipleTargetInfo) GetTag() []string {
type OverrideInfo (line 328) | type OverrideInfo struct
method Reset (line 335) | func (x *OverrideInfo) Reset() {
method String (line 342) | func (x *OverrideInfo) String() string {
method ProtoMessage (line 346) | func (*OverrideInfo) ProtoMessage() {}
method ProtoReflect (line 348) | func (x *OverrideInfo) ProtoReflect() protoreflect.Message {
method Descriptor (line 361) | func (*OverrideInfo) Descriptor() ([]byte, []int) {
method GetTarget (line 365) | func (x *OverrideInfo) GetTarget() string {
type BalancerMsg (line 372) | type BalancerMsg struct
method Reset (line 380) | func (x *BalancerMsg) Reset() {
method String (line 387) | func (x *BalancerMsg) String() string {
method ProtoMessage (line 391) | func (*BalancerMsg) ProtoMessage() {}
method ProtoReflect (line 393) | func (x *BalancerMsg) ProtoReflect() protoreflect.Message {
method Descriptor (line 406) | func (*BalancerMsg) Descriptor() ([]byte, []int) {
method GetOverride (line 410) | func (x *BalancerMsg) GetOverride() *OverrideInfo {
method GetPrincipleTarget (line 417) | func (x *BalancerMsg) GetPrincipleTarget() *PrincipleTargetInfo {
type GetBalancerInfoRequest (line 424) | type GetBalancerInfoRequest struct
method Reset (line 431) | func (x *GetBalancerInfoRequest) Reset() {
method String (line 438) | func (x *GetBalancerInfoRequest) String() string {
method ProtoMessage (line 442) | func (*GetBalancerInfoRequest) ProtoMessage() {}
method ProtoReflect (line 444) | func (x *GetBalancerInfoRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 457) | func (*GetBalancerInfoRequest) Descriptor() ([]byte, []int) {
method GetTag (line 461) | func (x *GetBalancerInfoRequest) GetTag() string {
type GetBalancerInfoResponse (line 468) | type GetBalancerInfoResponse struct
method Reset (line 475) | func (x *GetBalancerInfoResponse) Reset() {
method String (line 482) | func (x *GetBalancerInfoResponse) String() string {
method ProtoMessage (line 486) | func (*GetBalancerInfoResponse) ProtoMessage() {}
method ProtoReflect (line 488) | func (x *GetBalancerInfoResponse) ProtoReflect() protoreflect.Message {
method Descriptor (line 501) | func (*GetBalancerInfoResponse) Descriptor() ([]byte, []int) {
method GetBalancer (line 505) | func (x *GetBalancerInfoResponse) GetBalancer() *BalancerMsg {
type OverrideBalancerTargetRequest (line 512) | type OverrideBalancerTargetRequest struct
method Reset (line 520) | func (x *OverrideBalancerTargetRequest) Reset() {
method String (line 527) | func (x *OverrideBalancerTargetRequest) String() string {
method ProtoMessage (line 531) | func (*OverrideBalancerTargetRequest) ProtoMessage() {}
method ProtoReflect (line 533) | func (x *OverrideBalancerTargetRequest) ProtoReflect() protoreflect.Me...
method Descriptor (line 546) | func (*OverrideBalancerTargetRequest) Descriptor() ([]byte, []int) {
method GetBalancerTag (line 550) | func (x *OverrideBalancerTargetRequest) GetBalancerTag() string {
method GetTarget (line 557) | func (x *OverrideBalancerTargetRequest) GetTarget() string {
type OverrideBalancerTargetResponse (line 564) | type OverrideBalancerTargetResponse struct
method Reset (line 570) | func (x *OverrideBalancerTargetResponse) Reset() {
method String (line 577) | func (x *OverrideBalancerTargetResponse) String() string {
method ProtoMessage (line 581) | func (*OverrideBalancerTargetResponse) ProtoMessage() {}
method ProtoReflect (line 583) | func (x *OverrideBalancerTargetResponse) ProtoReflect() protoreflect.M...
method Descriptor (line 596) | func (*OverrideBalancerTargetResponse) Descriptor() ([]byte, []int) {
type Config (line 600) | type Config struct
method Reset (line 606) | func (x *Config) Reset() {
method String (line 613) | func (x *Config) String() string {
method ProtoMessage (line 617) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 619) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 632) | func (*Config) Descriptor() ([]byte, []int) {
constant file_app_router_command_command_proto_rawDesc (line 638) | file_app_router_command_command_proto_rawDesc = "" +
function file_app_router_command_command_proto_rawDescGZIP (line 701) | func file_app_router_command_command_proto_rawDescGZIP() []byte {
function init (line 746) | func init() { file_app_router_command_command_proto_init() }
function file_app_router_command_command_proto_init (line 747) | func file_app_router_command_command_proto_init() {
FILE: app/router/command/command_grpc.pb.go
constant _ (line 13) | _ = grpc.SupportPackageIsVersion9
constant RoutingService_SubscribeRoutingStats_FullMethodName (line 16) | RoutingService_SubscribeRoutingStats_FullMethodName = "/v2ray.core.app....
constant RoutingService_TestRoute_FullMethodName (line 17) | RoutingService_TestRoute_FullMethodName = "/v2ray.core.app....
constant RoutingService_GetBalancerInfo_FullMethodName (line 18) | RoutingService_GetBalancerInfo_FullMethodName = "/v2ray.core.app....
constant RoutingService_OverrideBalancerTarget_FullMethodName (line 19) | RoutingService_OverrideBalancerTarget_FullMethodName = "/v2ray.core.app....
type RoutingServiceClient (line 25) | type RoutingServiceClient interface
type routingServiceClient (line 32) | type routingServiceClient struct
method SubscribeRoutingStats (line 40) | func (c *routingServiceClient) SubscribeRoutingStats(ctx context.Conte...
method TestRoute (line 59) | func (c *routingServiceClient) TestRoute(ctx context.Context, in *Test...
method GetBalancerInfo (line 69) | func (c *routingServiceClient) GetBalancerInfo(ctx context.Context, in...
method OverrideBalancerTarget (line 79) | func (c *routingServiceClient) OverrideBalancerTarget(ctx context.Cont...
function NewRoutingServiceClient (line 36) | func NewRoutingServiceClient(cc grpc.ClientConnInterface) RoutingService...
type RoutingServiceServer (line 92) | type RoutingServiceServer interface
type UnimplementedRoutingServiceServer (line 105) | type UnimplementedRoutingServiceServer struct
method SubscribeRoutingStats (line 107) | func (UnimplementedRoutingServiceServer) SubscribeRoutingStats(*Subscr...
method TestRoute (line 110) | func (UnimplementedRoutingServiceServer) TestRoute(context.Context, *T...
method GetBalancerInfo (line 113) | func (UnimplementedRoutingServiceServer) GetBalancerInfo(context.Conte...
method OverrideBalancerTarget (line 116) | func (UnimplementedRoutingServiceServer) OverrideBalancerTarget(contex...
method mustEmbedUnimplementedRoutingServiceServer (line 119) | func (UnimplementedRoutingServiceServer) mustEmbedUnimplementedRouting...
method testEmbeddedByValue (line 120) | func (UnimplementedRoutingServiceServer) testEmbeddedByValue() ...
type UnsafeRoutingServiceServer (line 125) | type UnsafeRoutingServiceServer interface
function RegisterRoutingServiceServer (line 129) | func RegisterRoutingServiceServer(s grpc.ServiceRegistrar, srv RoutingSe...
function _RoutingService_SubscribeRoutingStats_Handler (line 140) | func _RoutingService_SubscribeRoutingStats_Handler(srv interface{}, stre...
function _RoutingService_TestRoute_Handler (line 151) | func _RoutingService_TestRoute_Handler(srv interface{}, ctx context.Cont...
function _RoutingService_GetBalancerInfo_Handler (line 169) | func _RoutingService_GetBalancerInfo_Handler(srv interface{}, ctx contex...
function _RoutingService_OverrideBalancerTarget_Handler (line 187) | func _RoutingService_OverrideBalancerTarget_Handler(srv interface{}, ctx...
FILE: app/router/command/command_test.go
function TestServiceSubscribeRoutingStats (line 25) | func TestServiceSubscribeRoutingStats(t *testing.T) {
function TestSerivceTestRoute (line 211) | func TestSerivceTestRoute(t *testing.T) {
FILE: app/router/command/config.go
type routingContext (line 11) | type routingContext struct
method GetSourceIPs (line 15) | func (c routingContext) GetSourceIPs() []net.IP {
method GetSourcePort (line 19) | func (c routingContext) GetSourcePort() net.Port {
method GetTargetIPs (line 23) | func (c routingContext) GetTargetIPs() []net.IP {
method GetTargetPort (line 27) | func (c routingContext) GetTargetPort() net.Port {
method GetSkipDNSResolve (line 34) | func (c routingContext) GetSkipDNSResolve() bool {
function AsRoutingContext (line 39) | func AsRoutingContext(r *RoutingContext) routing.Context {
function AsRoutingRoute (line 44) | func AsRoutingRoute(r *RoutingContext) routing.Route {
function AsProtobufMessage (line 64) | func AsProtobufMessage(fieldSelectors []string) func(routing.Route) *Rou...
function mapBytesToIPs (line 87) | func mapBytesToIPs(bytes [][]byte) []net.IP {
function mapIPsToBytes (line 95) | func mapIPsToBytes(ips []net.IP) [][]byte {
FILE: app/router/command/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/router/condition.go
type Condition (line 15) | type Condition interface
type ConditionChan (line 19) | type ConditionChan
method Add (line 26) | func (v *ConditionChan) Add(cond Condition) *ConditionChan {
method Apply (line 32) | func (v *ConditionChan) Apply(ctx routing.Context) bool {
method Len (line 41) | func (v *ConditionChan) Len() int {
function NewConditionChan (line 21) | func NewConditionChan() *ConditionChan {
function domainToMatcher (line 52) | func domainToMatcher(domain *routercommon.Domain) (strmatcher.Matcher, e...
type DomainMatcher (line 66) | type DomainMatcher struct
method Match (line 93) | func (m *DomainMatcher) Match(domain string) bool {
method Apply (line 98) | func (m *DomainMatcher) Apply(ctx routing.Context) bool {
function NewDomainMatcher (line 70) | func NewDomainMatcher(matcherType string, domains []*routercommon.Domain...
type MultiGeoIPMatcher (line 106) | type MultiGeoIPMatcher struct
method Apply (line 130) | func (m *MultiGeoIPMatcher) Apply(ctx routing.Context) bool {
function NewMultiGeoIPMatcher (line 111) | func NewMultiGeoIPMatcher(geoips []*routercommon.GeoIP, onSource bool) (...
type PortMatcher (line 147) | type PortMatcher struct
method Apply (line 161) | func (v *PortMatcher) Apply(ctx routing.Context) bool {
function NewPortMatcher (line 153) | func NewPortMatcher(list *net.PortList, onSource bool) *PortMatcher {
type NetworkMatcher (line 168) | type NetworkMatcher struct
method Apply (line 181) | func (v NetworkMatcher) Apply(ctx routing.Context) bool {
function NewNetworkMatcher (line 172) | func NewNetworkMatcher(network []net.Network) NetworkMatcher {
type UserMatcher (line 185) | type UserMatcher struct
method Apply (line 202) | func (v *UserMatcher) Apply(ctx routing.Context) bool {
function NewUserMatcher (line 189) | func NewUserMatcher(users []string) *UserMatcher {
type InboundTagMatcher (line 215) | type InboundTagMatcher struct
method Apply (line 232) | func (v *InboundTagMatcher) Apply(ctx routing.Context) bool {
function NewInboundTagMatcher (line 219) | func NewInboundTagMatcher(tags []string) *InboundTagMatcher {
type ProtocolMatcher (line 245) | type ProtocolMatcher struct
method Apply (line 264) | func (m *ProtocolMatcher) Apply(ctx routing.Context) bool {
function NewProtocolMatcher (line 249) | func NewProtocolMatcher(protocols []string) *ProtocolMatcher {
type AttributeMatcher (line 277) | type AttributeMatcher struct
method Match (line 298) | func (m *AttributeMatcher) Match(attrs map[string]string) bool {
method Apply (line 319) | func (m *AttributeMatcher) Apply(ctx routing.Context) bool {
function NewAttributeMatcher (line 281) | func NewAttributeMatcher(code string) (*AttributeMatcher, error) {
FILE: app/router/condition_geoip.go
type GeoIPMatcher (line 12) | type GeoIPMatcher struct
method Init (line 19) | func (m *GeoIPMatcher) Init(cidrs []*routercommon.CIDR) error {
method SetReverseMatch (line 50) | func (m *GeoIPMatcher) SetReverseMatch(isReverseMatch bool) {
method match4 (line 54) | func (m *GeoIPMatcher) match4(ip net.IP) bool {
method match6 (line 62) | func (m *GeoIPMatcher) match6(ip net.IP) bool {
method Match (line 71) | func (m *GeoIPMatcher) Match(ip net.IP) bool {
type GeoIPMatcherContainer (line 86) | type GeoIPMatcherContainer struct
method Add (line 92) | func (c *GeoIPMatcherContainer) Add(geoip *routercommon.GeoIP) (*GeoIP...
FILE: app/router/condition_geoip_test.go
function init (line 20) | func init() {
function TestGeoIPMatcherContainer (line 39) | func TestGeoIPMatcherContainer(t *testing.T) {
function TestGeoIPMatcher (line 66) | func TestGeoIPMatcher(t *testing.T) {
function TestGeoIPReverseMatcher (line 138) | func TestGeoIPReverseMatcher(t *testing.T) {
function TestGeoIPMatcher4CN (line 174) | func TestGeoIPMatcher4CN(t *testing.T) {
function TestGeoIPMatcher6US (line 186) | func TestGeoIPMatcher6US(t *testing.T) {
function loadGeoIP (line 198) | func loadGeoIP(country string) ([]*routercommon.CIDR, error) {
function BenchmarkGeoIPMatcher4CN (line 217) | func BenchmarkGeoIPMatcher4CN(b *testing.B) {
function BenchmarkGeoIPMatcher6US (line 231) | func BenchmarkGeoIPMatcher6US(b *testing.B) {
FILE: app/router/condition_test.go
function init (line 26) | func init() {
function withBackground (line 55) | func withBackground() routing.Context {
function withOutbound (line 59) | func withOutbound(outbound *session.Outbound) routing.Context {
function withInbound (line 63) | func withInbound(inbound *session.Inbound) routing.Context {
function withContent (line 67) | func withContent(content *session.Content) routing.Context {
function TestRoutingRule (line 71) | func TestRoutingRule(t *testing.T) {
function loadGeoSite (line 355) | func loadGeoSite(country string) ([]*routercommon.Domain, error) {
function TestChinaSites (line 374) | func TestChinaSites(t *testing.T) {
function BenchmarkMphDomainMatcher (line 421) | func BenchmarkMphDomainMatcher(b *testing.B) {
function BenchmarkDomainMatcher (line 463) | func BenchmarkDomainMatcher(b *testing.B) {
function BenchmarkMultiGeoIPMatcher (line 505) | func BenchmarkMultiGeoIPMatcher(b *testing.B) {
FILE: app/router/config.go
type Rule (line 20) | type Rule struct
method GetTag (line 26) | func (r *Rule) GetTag() (string, error) {
method Apply (line 34) | func (r *Rule) Apply(ctx routing.Context) bool {
method BuildCondition (line 38) | func (rr *RoutingRule) BuildCondition() (Condition, error) {
method Build (line 133) | func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing....
method UnmarshalJSONPB (line 189) | func (br *BalancingRule) UnmarshalJSONPB(unmarshaler *jsonpb.Unmarshaler...
FILE: app/router/config.pb.go
constant _ (line 17) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 19) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type DomainStrategy (line 22) | type DomainStrategy
method Enum (line 51) | func (x DomainStrategy) Enum() *DomainStrategy {
method String (line 57) | func (x DomainStrategy) String() string {
method Descriptor (line 61) | func (DomainStrategy) Descriptor() protoreflect.EnumDescriptor {
method Type (line 65) | func (DomainStrategy) Type() protoreflect.EnumType {
method Number (line 69) | func (x DomainStrategy) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 74) | func (DomainStrategy) EnumDescriptor() ([]byte, []int) {
constant DomainStrategy_AsIs (line 26) | DomainStrategy_AsIs DomainStrategy = 0
constant DomainStrategy_UseIp (line 28) | DomainStrategy_UseIp DomainStrategy = 1
constant DomainStrategy_IpIfNonMatch (line 30) | DomainStrategy_IpIfNonMatch DomainStrategy = 2
constant DomainStrategy_IpOnDemand (line 32) | DomainStrategy_IpOnDemand DomainStrategy = 3
type RoutingRule (line 78) | type RoutingRule struct
method Reset (line 130) | func (x *RoutingRule) Reset() {
method String (line 137) | func (x *RoutingRule) String() string {
method ProtoMessage (line 141) | func (*RoutingRule) ProtoMessage() {}
method ProtoReflect (line 143) | func (x *RoutingRule) ProtoReflect() protoreflect.Message {
method Descriptor (line 156) | func (*RoutingRule) Descriptor() ([]byte, []int) {
method GetTargetTag (line 160) | func (x *RoutingRule) GetTargetTag() isRoutingRule_TargetTag {
method GetTag (line 167) | func (x *RoutingRule) GetTag() string {
method GetBalancingTag (line 176) | func (x *RoutingRule) GetBalancingTag() string {
method GetDomain (line 185) | func (x *RoutingRule) GetDomain() []*routercommon.Domain {
method GetCidr (line 193) | func (x *RoutingRule) GetCidr() []*routercommon.CIDR {
method GetGeoip (line 200) | func (x *RoutingRule) GetGeoip() []*routercommon.GeoIP {
method GetPortRange (line 208) | func (x *RoutingRule) GetPortRange() *net.PortRange {
method GetPortList (line 215) | func (x *RoutingRule) GetPortList() *net.PortList {
method GetNetworkList (line 223) | func (x *RoutingRule) GetNetworkList() *net.NetworkList {
method GetNetworks (line 230) | func (x *RoutingRule) GetNetworks() []net.Network {
method GetSourceCidr (line 238) | func (x *RoutingRule) GetSourceCidr() []*routercommon.CIDR {
method GetSourceGeoip (line 245) | func (x *RoutingRule) GetSourceGeoip() []*routercommon.GeoIP {
method GetSourcePortList (line 252) | func (x *RoutingRule) GetSourcePortList() *net.PortList {
method GetUserEmail (line 259) | func (x *RoutingRule) GetUserEmail() []string {
method GetInboundTag (line 266) | func (x *RoutingRule) GetInboundTag() []string {
method GetProtocol (line 273) | func (x *RoutingRule) GetProtocol() []string {
method GetAttributes (line 280) | func (x *RoutingRule) GetAttributes() string {
method GetDomainMatcher (line 287) | func (x *RoutingRule) GetDomainMatcher() string {
method GetGeoDomain (line 294) | func (x *RoutingRule) GetGeoDomain() []*routercommon.GeoSite {
type isRoutingRule_TargetTag (line 301) | type isRoutingRule_TargetTag interface
type RoutingRule_Tag (line 305) | type RoutingRule_Tag struct
method isRoutingRule_TargetTag (line 315) | func (*RoutingRule_Tag) isRoutingRule_TargetTag() {}
type RoutingRule_BalancingTag (line 310) | type RoutingRule_BalancingTag struct
method isRoutingRule_TargetTag (line 317) | func (*RoutingRule_BalancingTag) isRoutingRule_TargetTag() {}
type BalancingRule (line 319) | type BalancingRule struct
method Reset (line 330) | func (x *BalancingRule) Reset() {
method String (line 337) | func (x *BalancingRule) String() string {
method ProtoMessage (line 341) | func (*BalancingRule) ProtoMessage() {}
method ProtoReflect (line 343) | func (x *BalancingRule) ProtoReflect() protoreflect.Message {
method Descriptor (line 356) | func (*BalancingRule) Descriptor() ([]byte, []int) {
method GetTag (line 360) | func (x *BalancingRule) GetTag() string {
method GetOutboundSelector (line 367) | func (x *BalancingRule) GetOutboundSelector() []string {
method GetStrategy (line 374) | func (x *BalancingRule) GetStrategy() string {
method GetStrategySettings (line 381) | func (x *BalancingRule) GetStrategySettings() *anypb.Any {
method GetFallbackTag (line 388) | func (x *BalancingRule) GetFallbackTag() string {
type StrategyWeight (line 395) | type StrategyWeight struct
method Reset (line 404) | func (x *StrategyWeight) Reset() {
method String (line 411) | func (x *StrategyWeight) String() string {
method ProtoMessage (line 415) | func (*StrategyWeight) ProtoMessage() {}
method ProtoReflect (line 417) | func (x *StrategyWeight) ProtoReflect() protoreflect.Message {
method Descriptor (line 430) | func (*StrategyWeight) Descriptor() ([]byte, []int) {
method GetRegexp (line 434) | func (x *StrategyWeight) GetRegexp() bool {
method GetMatch (line 441) | func (x *StrategyWeight) GetMatch() string {
method GetValue (line 448) | func (x *StrategyWeight) GetValue() float32 {
type StrategyRandomConfig (line 455) | type StrategyRandomConfig struct
method Reset (line 463) | func (x *StrategyRandomConfig) Reset() {
method String (line 470) | func (x *StrategyRandomConfig) String() string {
method ProtoMessage (line 474) | func (*StrategyRandomConfig) ProtoMessage() {}
method ProtoReflect (line 476) | func (x *StrategyRandomConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 489) | func (*StrategyRandomConfig) Descriptor() ([]byte, []int) {
method GetObserverTag (line 493) | func (x *StrategyRandomConfig) GetObserverTag() string {
method GetAliveOnly (line 500) | func (x *StrategyRandomConfig) GetAliveOnly() bool {
type StrategyLeastPingConfig (line 507) | type StrategyLeastPingConfig struct
method Reset (line 515) | func (x *StrategyLeastPingConfig) Reset() {
method String (line 522) | func (x *StrategyLeastPingConfig) String() string {
method ProtoMessage (line 526) | func (*StrategyLeastPingConfig) ProtoMessage() {}
method ProtoReflect (line 528) | func (x *StrategyLeastPingConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 541) | func (*StrategyLeastPingConfig) Descriptor() ([]byte, []int) {
method GetObserverTag (line 545) | func (x *StrategyLeastPingConfig) GetObserverTag() string {
method GetStickyChoice (line 552) | func (x *StrategyLeastPingConfig) GetStickyChoice() bool {
type StrategyLeastLoadConfig (line 559) | type StrategyLeastLoadConfig struct
method Reset (line 576) | func (x *StrategyLeastLoadConfig) Reset() {
method String (line 583) | func (x *StrategyLeastLoadConfig) String() string {
method ProtoMessage (line 587) | func (*StrategyLeastLoadConfig) ProtoMessage() {}
method ProtoReflect (line 589) | func (x *StrategyLeastLoadConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 602) | func (*StrategyLeastLoadConfig) Descriptor() ([]byte, []int) {
method GetCosts (line 606) | func (x *StrategyLeastLoadConfig) GetCosts() []*StrategyWeight {
method GetBaselines (line 613) | func (x *StrategyLeastLoadConfig) GetBaselines() []int64 {
method GetExpected (line 620) | func (x *StrategyLeastLoadConfig) GetExpected() int32 {
method GetMaxRTT (line 627) | func (x *StrategyLeastLoadConfig) GetMaxRTT() int64 {
method GetTolerance (line 634) | func (x *StrategyLeastLoadConfig) GetTolerance() float32 {
method GetObserverTag (line 641) | func (x *StrategyLeastLoadConfig) GetObserverTag() string {
type Config (line 648) | type Config struct
method Reset (line 657) | func (x *Config) Reset() {
method String (line 664) | func (x *Config) String() string {
method ProtoMessage (line 668) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 670) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 683) | func (*Config) Descriptor() ([]byte, []int) {
method GetDomainStrategy (line 687) | func (x *Config) GetDomainStrategy() DomainStrategy {
method GetRule (line 694) | func (x *Config) GetRule() []*RoutingRule {
method GetBalancingRule (line 701) | func (x *Config) GetBalancingRule() []*BalancingRule {
type SimplifiedRoutingRule (line 708) | type SimplifiedRoutingRule struct
method Reset (line 742) | func (x *SimplifiedRoutingRule) Reset() {
method String (line 749) | func (x *SimplifiedRoutingRule) String() string {
method ProtoMessage (line 753) | func (*SimplifiedRoutingRule) ProtoMessage() {}
method ProtoReflect (line 755) | func (x *SimplifiedRoutingRule) ProtoReflect() protoreflect.Message {
method Descriptor (line 768) | func (*SimplifiedRoutingRule) Descriptor() ([]byte, []int) {
method GetTargetTag (line 772) | func (x *SimplifiedRoutingRule) GetTargetTag() isSimplifiedRoutingRule...
method GetTag (line 779) | func (x *SimplifiedRoutingRule) GetTag() string {
method GetBalancingTag (line 788) | func (x *SimplifiedRoutingRule) GetBalancingTag() string {
method GetDomain (line 797) | func (x *SimplifiedRoutingRule) GetDomain() []*routercommon.Domain {
method GetGeoip (line 804) | func (x *SimplifiedRoutingRule) GetGeoip() []*routercommon.GeoIP {
method GetPortList (line 811) | func (x *SimplifiedRoutingRule) GetPortList() string {
method GetNetworks (line 818) | func (x *SimplifiedRoutingRule) GetNetworks() *net.NetworkList {
method GetSourceGeoip (line 825) | func (x *SimplifiedRoutingRule) GetSourceGeoip() []*routercommon.GeoIP {
method GetSourcePortList (line 832) | func (x *SimplifiedRoutingRule) GetSourcePortList() string {
method GetUserEmail (line 839) | func (x *SimplifiedRoutingRule) GetUserEmail() []string {
method GetInboundTag (line 846) | func (x *SimplifiedRoutingRule) GetInboundTag() []string {
method GetProtocol (line 853) | func (x *SimplifiedRoutingRule) GetProtocol() []string {
method GetAttributes (line 860) | func (x *SimplifiedRoutingRule) GetAttributes() string {
method GetDomainMatcher (line 867) | func (x *SimplifiedRoutingRule) GetDomainMatcher() string {
method GetGeoDomain (line 874) | func (x *SimplifiedRoutingRule) GetGeoDomain() []*routercommon.GeoSite {
type isSimplifiedRoutingRule_TargetTag (line 881) | type isSimplifiedRoutingRule_TargetTag interface
type SimplifiedRoutingRule_Tag (line 885) | type SimplifiedRoutingRule_Tag struct
method isSimplifiedRoutingRule_TargetTag (line 895) | func (*SimplifiedRoutingRule_Tag) isSimplifiedRoutingRule_TargetTag() {}
type SimplifiedRoutingRule_BalancingTag (line 890) | type SimplifiedRoutingRule_BalancingTag struct
method isSimplifiedRoutingRule_TargetTag (line 897) | func (*SimplifiedRoutingRule_BalancingTag) isSimplifiedRoutingRule_Tar...
type SimplifiedConfig (line 899) | type SimplifiedConfig struct
method Reset (line 908) | func (x *SimplifiedConfig) Reset() {
method String (line 915) | func (x *SimplifiedConfig) String() string {
method ProtoMessage (line 919) | func (*SimplifiedConfig) ProtoMessage() {}
method ProtoReflect (line 921) | func (x *SimplifiedConfig) ProtoReflect() protoreflect.Message {
method Descriptor (line 934) | func (*SimplifiedConfig) Descriptor() ([]byte, []int) {
method GetDomainStrategy (line 938) | func (x *SimplifiedConfig) GetDomainStrategy() DomainStrategy {
method GetRule (line 945) | func (x *SimplifiedConfig) GetRule() []*SimplifiedRoutingRule {
method GetBalancingRule (line 952) | func (x *SimplifiedConfig) GetBalancingRule() []*BalancingRule {
constant file_app_router_config_proto_rawDesc (line 961) | file_app_router_config_proto_rawDesc = "" +
function file_app_router_config_proto_rawDescGZIP (line 1065) | func file_app_router_config_proto_rawDescGZIP() []byte {
function init (line 1127) | func init() { file_app_router_config_proto_init() }
function file_app_router_config_proto_init (line 1128) | func file_app_router_config_proto_init() {
FILE: app/router/errors.generated.go
type errPathObjHolder (line 5) | type errPathObjHolder struct
function newError (line 7) | func newError(values ...interface{}) *errors.Error {
FILE: app/router/router.go
type Router (line 20) | type Router struct
method Init (line 35) | func (r *Router) Init(ctx context.Context, config *Config, d dns.Clien...
method PickRoute (line 74) | func (r *Router) PickRoute(ctx routing.Context) (routing.Route, error) {
method pickRouteInternal (line 86) | func (r *Router) pickRouteInternal(ctx routing.Context) (*Rule, routin...
method Start (line 119) | func (r *Router) Start() error {
method Close (line 124) | func (r *Router) Close() error {
method Type (line 129) | func (*Router) Type() interface{} {
type Route (line 28) | type Route struct
method GetOutboundGroupTags (line 134) | func (r *Route) GetOutboundGroupTags() []string {
method GetOutboundTag (line 139) | func (r *Route) GetOutboundTag() string {
function init (line 143) | func init() {
FILE: app/router/router_test.go
type mockOutboundManager (line 19) | type mockOutboundManager struct
function TestSimpleRouter (line 24) | func TestSimpleRouter(t *testing.T) {
function TestSimpleBalancer (line 57) | func TestSimpleBalancer(t *testing.T) {
function TestIPOnDemand (line 147) | func TestIPOnDemand(t *testing.T) {
function TestIPIfNonMatchDomain (line 182) | func TestIPIfNonMatchDomain(t *testing.T) {
function TestIPIfNonMatchIP (line 217) | func TestIPIfNonMatchIP(t *testing.T) {
FILE: app/router/routercommon/common.pb.go
constant _ (line 14) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 16) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type Domain_Type (line 20) | type Domain_Type
method Enum (line 49) | func (x Domain_Type) Enum() *Domain_Type {
method String (line 55) | func (x Domain_Type) String() string {
method Descriptor (line 59) | func (Domain_Type) Descriptor() protoreflect.EnumDescriptor {
method Type (line 63) | func (Domain_Type) Type() protoreflect.EnumType {
method Number (line 67) | func (x Domain_Type) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 72) | func (Domain_Type) EnumDescriptor() ([]byte, []int) {
constant Domain_Plain (line 24) | Domain_Plain Domain_Type = 0
constant Domain_Regex (line 26) | Domain_Regex Domain_Type = 1
constant Domain_RootDomain (line 28) | Domain_RootDomain Domain_Type = 2
constant Domain_Full (line 30) | Domain_Full Domain_Type = 3
type Domain (line 77) | type Domain struct
method Reset (line 89) | func (x *Domain) Reset() {
method String (line 96) | func (x *Domain) String() string {
method ProtoMessage (line 100) | func (*Domain) ProtoMessage() {}
method ProtoReflect (line 102) | func (x *Domain) ProtoReflect() protoreflect.Message {
method Descriptor (line 115) | func (*Domain) Descriptor() ([]byte, []int) {
method GetType (line 119) | func (x *Domain) GetType() Domain_Type {
method GetValue (line 126) | func (x *Domain) GetValue() string {
method GetAttribute (line 133) | func (x *Domain) GetAttribute() []*Domain_Attribute {
type CIDR (line 141) | type CIDR struct
method Reset (line 152) | func (x *CIDR) Reset() {
method String (line 159) | func (x *CIDR) String() string {
method ProtoMessage (line 163) | func (*CIDR) ProtoMessage() {}
method ProtoReflect (line 165) | func (x *CIDR) ProtoReflect() protoreflect.Message {
method Descriptor (line 178) | func (*CIDR) Descriptor() ([]byte, []int) {
method GetIp (line 182) | func (x *CIDR) GetIp() []byte {
method GetPrefix (line 189) | func (x *CIDR) GetPrefix() uint32 {
method GetIpAddr (line 196) | func (x *CIDR) GetIpAddr() string {
type GeoIP (line 203) | type GeoIP struct
method Reset (line 216) | func (x *GeoIP) Reset() {
method String (line 223) | func (x *GeoIP) String() string {
method ProtoMessage (line 227) | func (*GeoIP) ProtoMessage() {}
method ProtoReflect (line 229) | func (x *GeoIP) ProtoReflect() protoreflect.Message {
method Descriptor (line 242) | func (*GeoIP) Descriptor() ([]byte, []int) {
method GetCountryCode (line 246) | func (x *GeoIP) GetCountryCode() string {
method GetCidr (line 253) | func (x *GeoIP) GetCidr() []*CIDR {
method GetInverseMatch (line 260) | func (x *GeoIP) GetInverseMatch() bool {
method GetResourceHash (line 267) | func (x *GeoIP) GetResourceHash() []byte {
method GetCode (line 274) | func (x *GeoIP) GetCode() string {
method GetFilePath (line 281) | func (x *GeoIP) GetFilePath() string {
type GeoIPList (line 288) | type GeoIPList struct
method Reset (line 295) | func (x *GeoIPList) Reset() {
method String (line 302) | func (x *GeoIPList) String() string {
method ProtoMessage (line 306) | func (*GeoIPList) ProtoMessage() {}
method ProtoReflect (line 308) | func (x *GeoIPList) ProtoReflect() protoreflect.Message {
method Descriptor (line 321) | func (*GeoIPList) Descriptor() ([]byte, []int) {
method GetEntry (line 325) | func (x *GeoIPList) GetEntry() []*GeoIP {
type GeoSite (line 332) | type GeoSite struct
method Reset (line 344) | func (x *GeoSite) Reset() {
method String (line 351) | func (x *GeoSite) String() string {
method ProtoMessage (line 355) | func (*GeoSite) ProtoMessage() {}
method ProtoReflect (line 357) | func (x *GeoSite) ProtoReflect() protoreflect.Message {
method Descriptor (line 370) | func (*GeoSite) Descriptor() ([]byte, []int) {
method GetCountryCode (line 374) | func (x *GeoSite) GetCountryCode() string {
method GetDomain (line 381) | func (x *GeoSite) GetDomain() []*Domain {
method GetResourceHash (line 388) | func (x *GeoSite) GetResourceHash() []byte {
method GetCode (line 395) | func (x *GeoSite) GetCode() string {
method GetFilePath (line 402) | func (x *GeoSite) GetFilePath() string {
type GeoSiteList (line 409) | type GeoSiteList struct
method Reset (line 416) | func (x *GeoSiteList) Reset() {
method String (line 423) | func (x *GeoSiteList) String() string {
method ProtoMessage (line 427) | func (*GeoSiteList) ProtoMessage() {}
method ProtoReflect (line 429) | func (x *GeoSiteList) ProtoReflect() protoreflect.Message {
method Descriptor (line 442) | func (*GeoSiteList) Descriptor() ([]byte, []int) {
method GetEntry (line 446) | func (x *GeoSiteList) GetEntry() []*GeoSite {
type Domain_Attribute (line 453) | type Domain_Attribute struct
method Reset (line 465) | func (x *Domain_Attribute) Reset() {
method String (line 472) | func (x *Domain_Attribute) String() string {
method ProtoMessage (line 476) | func (*Domain_Attribute) ProtoMessage() {}
method ProtoReflect (line 478) | func (x *Domain_Attribute) ProtoReflect() protoreflect.Message {
method Descriptor (line 491) | func (*Domain_Attribute) Descriptor() ([]byte, []int) {
method GetKey (line 495) | func (x *Domain_Attribute) GetKey() string {
method GetTypedValue (line 502) | func (x *Domain_Attribute) GetTypedValue() isDomain_Attribute_TypedVal...
method GetBoolValue (line 509) | func (x *Domain_Attribute) GetBoolValue() bool {
method GetIntValue (line 518) | func (x *Domain_Attribute) GetIntValue() int64 {
type isDomain_Attribute_TypedValue (line 527) | type isDomain_Attribute_TypedValue interface
type Domain_Attribute_BoolValue (line 531) | type Domain_Attribute_BoolValue struct
method isDomain_Attribute_TypedValue (line 539) | func (*Domain_Attribute_BoolValue) isDomain_Attribute_TypedValue() {}
type Domain_Attribute_IntValue (line 535) | type Domain_Attribute_IntValue struct
method isDomain_Attribute_TypedValue (line 541) | func (*Domain_Attribute_IntValue) isDomain_Attribute_TypedValue() {}
constant file_app_router_routercommon_common_proto_rawDesc (line 545) | file_app_router_routercommon_common_proto_rawDesc = "" +
function file_app_router_routercommon_common_proto_rawDescGZIP (line 592) | func file_app_router_routercommon_common_proto_rawDescGZIP() []byte {
function init (line 625) | func init() { file_app_router_routercommon_common_proto_init() }
function file_app_router_routercommon_common_proto_init (line 626) | func file_app_router_routercommon_common_proto_init() {
FILE: app/router/strategy_leastload.go
type LeastLoadStrategy (line 20) | type LeastLoadStrategy struct
method GetPrincipleTarget (line 29) | func (l *LeastLoadStrategy) GetPrincipleTarget(strings []string) []str...
method InjectContext (line 63) | func (l *LeastLoadStrategy) InjectContext(ctx context.Context) {
method PickOutbound (line 67) | func (l *LeastLoadStrategy) PickOutbound(candidates []string) string {
method pickOutbounds (line 77) | func (l *LeastLoadStrategy) pickOutbounds(candidates []string) []*node {
method selectLeastLoad (line 99) | func (l *LeastLoadStrategy) selectLeastLoad(nodes []*node) []*node {
method getNodes (line 139) | func (l *LeastLoadStrategy) getNodes(candidates []string, maxRTT time....
function NewLeastLoadStrategy (line 39) | func NewLeastLoadStrategy(settings *StrategyLeastLoadConfig) *LeastLoadS...
type node (line 54) | type node struct
function leastloadSort (line 196) | func leastloadSort(nodes []*node) {
function init (line 216) | func init() {
FILE: app/router/strategy_leastload_test.go
function TestSelectLeastExpected (line 69) | func TestSelectLeastExpected(t *testing.T) {
function TestSelectLeastExpected2 (line 89) | func TestSelectLeastExpected2(t *testing.T) {
function TestSelectLeastExpectedAndBaselines (line 107) | func TestSelectLeastExpectedAndBaselines(t *testing.T) {
function TestSelectLeastExpectedAndBaselines2 (line 128) | func TestSelectLeastExpectedAndBaselines2(t *testing.T) {
function TestSelectLeastLoadBaselines (line 149) | func TestSelectLeastLoadBaselines(t *testing.T) {
function TestSelectLeastLoadBaselinesNoQualified (line 168) | func TestSelectLeastLoadBaselinesNoQualified(t *testing.T) {
FILE: app/router/strategy_leastping.go
type LeastPingStrategy (line 17) | type LeastPingStrategy struct
method GetPrincipleTarget (line 27) | func (l *LeastPingStrategy) GetPrincipleTarget(strings []string) []str...
method InjectContext (line 31) | func (l *LeastPingStrategy) InjectContext(ctx context.Context) {
method PickOutbound (line 35) | func (l *LeastPingStrategy) PickOutbound(strings []string) string {
type outboundList (line 83) | type outboundList
method contains (line 85) | func (o outboundList) contains(name string) bool {
function init (line 94) | func init() {
FILE: app/router/strategy_random.go
type RandomStrategy (line 17) | type RandomStrategy struct
method GetPrincipleTarget (line 23) | func (s *RandomStrategy) GetPrincipleTarget(strings []string) []string {
method InjectContext (line 34) | func (s *RandomStrategy) InjectContext(ctx context.Context) {
method PickOutbound (line 40) | func (s *RandomStrategy) PickOutbound(candidates []string) string {
function NewRandomStrategy (line 28) | func NewRandomStrategy(settings *StrategyRandomConfig) *RandomStrategy {
function init (line 90) | func init() {
FILE: app/router/weight.go
type weightScaler (line 10) | type weightScaler
function NewWeightManager (line 15) | func NewWeightManager(s []*StrategyWeight, defaultWeight float64, scaler...
type WeightManager (line 25) | type WeightManager struct
method Get (line 34) | func (s *WeightManager) Get(tag string) float64 {
method Apply (line 47) | func (s *WeightManager) Apply(tag string, value float64) float64 {
method findValue (line 51) | func (s *WeightManager) findValue(tag string) float64 {
method getMatch (line 75) | func (s *WeightManager) getMatch(tag, find string, isRegexp bool) stri...
FILE: app/router/weight_test.go
function TestWeight (line 10) | func TestWeight(t *testing.T) {
FILE: app/stats/channel.go
type Channel (line 11) | type Channel struct
method Subscribers (line 36) | func (c *Channel) Subscribers() []chan interface{} {
method Subscribe (line 43) | func (c *Channel) Subscribe() (chan interface{}, error) {
method Unsubscribe (line 55) | func (c *Channel) Unsubscribe(subscriber chan interface{}) error {
method Publish (line 71) | func (c *Channel) Publish(ctx context.Context, msg interface{}) {
method Running (line 86) | func (c *Channel) Running() bool {
method Start (line 98) | func (c *Channel) Start() error {
method Close (line 128) | func (c *Channel) Close() error {
function NewChannel (line 26) | func NewChannel(config *ChannelConfig) *Channel {
type channelMessage (line 139) | type channelMessage struct
method publish (line 144) | func (c channelMessage) publish(publisher chan channelMessage) {
method publishNonBlocking (line 151) | func (c channelMessage) publishNonBlocking(publisher chan channelMessa...
method broadcast (line 159) | func (c channelMessage) broadcast(subscriber chan interface{}) {
method broadcastNonBlocking (line 166) | func (c channelMessage) broadcastNonBlocking(subscriber chan interface...
FILE: app/stats/channel_test.go
function TestStatsChannel (line 14) | func TestStatsChannel(t *testing.T) {
function TestStatsChannelUnsubcribe (line 98) | func TestStatsChannelUnsubcribe(t *testing.T) {
function TestStatsChannelBlocking (line 188) | func TestStatsChannelBlocking(t *testing.T) {
function TestStatsChannelNonBlocking (line 262) | func TestStatsChannelNonBlocking(t *testing.T) {
function TestStatsChannelConcurrency (line 338) | func TestStatsChannelConcurrency(t *testing.T) {
FILE: app/stats/command/command.go
type statsServer (line 20) | type statsServer struct
method GetStats (line 32) | func (s *statsServer) GetStats(ctx context.Context, request *GetStatsR...
method QueryStats (line 51) | func (s *statsServer) QueryStats(ctx context.Context, request *QuerySt...
method GetSysStats (line 94) | func (s *statsServer) GetSysStats(ctx context.Context, request *SysSta...
method mustEmbedUnimplementedStatsServiceServer (line 116) | func (s *statsServer) mustEmbedUnimplementedStatsServiceServer() {}
function NewStatsServer (line 25) | func NewStatsServer(manager feature_stats.Manager) StatsServiceServer {
type service (line 118) | type service struct
method Register (line 122) | func (s *service) Register(server *grpc.Server) {
function init (line 126) | func init() {
FILE: app/stats/command/command.pb.go
constant _ (line 14) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 16) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type GetStatsRequest (line 19) | type GetStatsRequest struct
method Reset (line 29) | func (x *GetStatsRequest) Reset() {
method String (line 36) | func (x *GetStatsRequest) String() string {
method ProtoMessage (line 40) | func (*GetStatsRequest) ProtoMessage() {}
method ProtoReflect (line 42) | func (x *GetStatsRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 55) | func (*GetStatsRequest) Descriptor() ([]byte, []int) {
method GetName (line 59) | func (x *GetStatsRequest) GetName() string {
method GetReset_ (line 66) | func (x *GetStatsRequest) GetReset_() bool {
type Stat (line 73) | type Stat struct
method Reset (line 81) | func (x *Stat) Reset() {
method String (line 88) | func (x *Stat) String() string {
method ProtoMessage (line 92) | func (*Stat) ProtoMessage() {}
method ProtoReflect (line 94) | func (x *Stat) ProtoReflect() protoreflect.Message {
method Descriptor (line 107) | func (*Stat) Descriptor() ([]byte, []int) {
method GetName (line 111) | func (x *Stat) GetName() string {
method GetValue (line 118) | func (x *Stat) GetValue() int64 {
type GetStatsResponse (line 125) | type GetStatsResponse struct
method Reset (line 132) | func (x *GetStatsResponse) Reset() {
method String (line 139) | func (x *GetStatsResponse) String() string {
method ProtoMessage (line 143) | func (*GetStatsResponse) ProtoMessage() {}
method ProtoReflect (line 145) | func (x *GetStatsResponse) ProtoReflect() protoreflect.Message {
method Descriptor (line 158) | func (*GetStatsResponse) Descriptor() ([]byte, []int) {
method GetStat (line 162) | func (x *GetStatsResponse) GetStat() *Stat {
type QueryStatsRequest (line 169) | type QueryStatsRequest struct
method Reset (line 180) | func (x *QueryStatsRequest) Reset() {
method String (line 187) | func (x *QueryStatsRequest) String() string {
method ProtoMessage (line 191) | func (*QueryStatsRequest) ProtoMessage() {}
method ProtoReflect (line 193) | func (x *QueryStatsRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 206) | func (*QueryStatsRequest) Descriptor() ([]byte, []int) {
method GetPattern (line 210) | func (x *QueryStatsRequest) GetPattern() string {
method GetReset_ (line 217) | func (x *QueryStatsRequest) GetReset_() bool {
method GetPatterns (line 224) | func (x *QueryStatsRequest) GetPatterns() []string {
method GetRegexp (line 231) | func (x *QueryStatsRequest) GetRegexp() bool {
type QueryStatsResponse (line 238) | type QueryStatsResponse struct
method Reset (line 245) | func (x *QueryStatsResponse) Reset() {
method String (line 252) | func (x *QueryStatsResponse) String() string {
method ProtoMessage (line 256) | func (*QueryStatsResponse) ProtoMessage() {}
method ProtoReflect (line 258) | func (x *QueryStatsResponse) ProtoReflect() protoreflect.Message {
method Descriptor (line 271) | func (*QueryStatsResponse) Descriptor() ([]byte, []int) {
method GetStat (line 275) | func (x *QueryStatsResponse) GetStat() []*Stat {
type SysStatsRequest (line 282) | type SysStatsRequest struct
method Reset (line 288) | func (x *SysStatsRequest) Reset() {
method String (line 295) | func (x *SysStatsRequest) String() string {
method ProtoMessage (line 299) | func (*SysStatsRequest) ProtoMessage() {}
method ProtoReflect (line 301) | func (x *SysStatsRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 314) | func (*SysStatsRequest) Descriptor() ([]byte, []int) {
type SysStatsResponse (line 318) | type SysStatsResponse struct
method Reset (line 334) | func (x *SysStatsResponse) Reset() {
method String (line 341) | func (x *SysStatsResponse) String() string {
method ProtoMessage (line 345) | func (*SysStatsResponse) ProtoMessage() {}
method ProtoReflect (line 347) | func (x *SysStatsResponse) ProtoReflect() protoreflect.Message {
method Descriptor (line 360) | func (*SysStatsResponse) Descriptor() ([]byte, []int) {
method GetNumGoroutine (line 364) | func (x *SysStatsResponse) GetNumGoroutine() uint32 {
method GetNumGC (line 371) | func (x *SysStatsResponse) GetNumGC() uint32 {
method GetAlloc (line 378) | func (x *SysStatsResponse) GetAlloc() uint64 {
method GetTotalAlloc (line 385) | func (x *SysStatsResponse) GetTotalAlloc() uint64 {
method GetSys (line 392) | func (x *SysStatsResponse) GetSys() uint64 {
method GetMallocs (line 399) | func (x *SysStatsResponse) GetMallocs() uint64 {
method GetFrees (line 406) | func (x *SysStatsResponse) GetFrees() uint64 {
method GetLiveObjects (line 413) | func (x *SysStatsResponse) GetLiveObjects() uint64 {
method GetPauseTotalNs (line 420) | func (x *SysStatsResponse) GetPauseTotalNs() uint64 {
method GetUptime (line 427) | func (x *SysStatsResponse) GetUptime() uint32 {
type Config (line 434) | type Config struct
method Reset (line 440) | func (x *Config) Reset() {
method String (line 447) | func (x *Config) String() string {
method ProtoMessage (line 451) | func (*Config) ProtoMessage() {}
method ProtoReflect (line 453) | func (x *Config) ProtoReflect() protoreflect.Message {
method Descriptor (line 466) | func (*Config) Descriptor() ([]byte, []int) {
constant file_app_stats_command_command_proto_rawDesc (line 472) | file_app_stats_command_command_proto_rawDesc = "" +
function file_app_stats_command_command_proto_rawDescGZIP (line 519) | func file_app_stats_command_command_proto_rawDescGZIP() []byte {
function init (line 553) | func init() { file_app_stats_command_command_proto_init() }
function file_app_stats_command_command_proto_init (line 554) | func file_app_stats_command_command_proto_init() {
FILE: app/stats/command/command_grpc.pb.go
constant _ (line 13) | _ = grpc.SupportPackageIsVersion9
constant StatsService_GetStats_FullMethodName (line 16) | StatsService_GetStats_FullMethodName = "/v2ray.core.app.stats.command...
constant StatsService_QueryStats_FullMethodName (line 17) | StatsService_QueryStats_FullMethodName = "/v2ray.core.app.stats.command...
constant StatsService_GetSysStats_FullMethodName (line 18) | StatsService_GetSysStats_FullMethodName = "/v2ray.core.app.stats.command...
type StatsServiceClient (line 24) | type StatsServiceClient interface
type statsServiceClient (line 30) | type statsServiceClient struct
method GetStats (line 38) | func (c *statsServiceClient) GetStats(ctx context.Context, in *GetStat...
method QueryStats (line 48) | func (c *statsServiceClient) QueryStats(ctx context.Context, in *Query...
method GetSysStats (line 58) | func (c *statsServiceClient) GetSysStats(ctx context.Context, in *SysS...
function NewStatsServiceClient (line 34) | func NewStatsServiceClient(cc grpc.ClientConnInterface) StatsServiceClie...
type StatsServiceServer (line 71) | type StatsS
Condensed preview — 1366 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (6,202K chars).
[
{
"path": ".github/CODE_OF_CONDUCT.md",
"chars": 5219,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make participa"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_cn.md",
"chars": 993,
"preview": "---\nname: V2Ray 程序问题\nabout: \"提交一个 V2Ray 的程序问题报告。\"\n---\n\n<!--\n除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。\n如果你遇到的问题不是 V2Ray 的 bug"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_en.md",
"chars": 1881,
"preview": "---\nname: Bug report\nabout: \"Create a bug report to help us improve\"\n---\n\n<!--\nPlease answer all the questions with enou"
},
{
"path": ".github/ISSUE_TEMPLATE/other_en.md",
"chars": 479,
"preview": "---\nname: Other\nabout: \"其它问题请使用 https://github.com/v2fly/v2ray-core/discussions 进行讨论 / Please discuss other issues at ht"
},
{
"path": ".github/ISSUE_TEMPLATE.md",
"chars": 297,
"preview": "如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用[Discussion](https://github.com/v2fly/discussion/issues)进行讨论。\n\n此 Issue 会被立即关闭。\n\nIf"
},
{
"path": ".github/dependabot.yml",
"chars": 562,
"preview": "# To get started with Dependabot version updates, you'll need to specify which\n# package ecosystems to update and where "
},
{
"path": ".github/workflows/codeql-analysis.yml",
"chars": 638,
"preview": "name: CodeQL\n\non:\n push:\n branches: [master]\n pull_request:\n branches: [master]\n types: [opened, synchronize,"
},
{
"path": ".github/workflows/linter.yml",
"chars": 756,
"preview": "name: Linter\n\non:\n push:\n branches:\n - master\n - v*\n paths:\n - \"**/*.go\"\n - \".github/workflow"
},
{
"path": ".github/workflows/release.yml",
"chars": 11865,
"preview": "name: Release\n\non:\n release:\n types:\n - prereleased\n - released\n push:\n branches:\n - master\n "
},
{
"path": ".github/workflows/sign.yml",
"chars": 708,
"preview": "name: Sign\n\non:\n release:\n types: [released]\n\njobs:\n sign:\n runs-on: ubuntu-latest\n steps:\n - name: Chec"
},
{
"path": ".github/workflows/stale.yml",
"chars": 641,
"preview": "name: Mark stale issues and pull requests\n\non:\n schedule:\n - cron: \"30 1 * * *\"\n\njobs:\n stale:\n runs-on: ubuntu-"
},
{
"path": ".github/workflows/test.yml",
"chars": 1334,
"preview": "name: Test\n\non:\n push:\n branches:\n - master\n - v*\n - dev*\n paths:\n - \"**/*.go\"\n - \"go.mo"
},
{
"path": ".gitignore",
"chars": 417,
"preview": "# Binaries for programs and plugins\n*.exe\n*.exe~\n*.dll\n*.so\n*.dylib\n\n# Test binary, built with `go test -c`\n*.test\n\n# Ou"
},
{
"path": "LICENSE",
"chars": 1087,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015-2025 V2Fly Community\n\nPermission is hereby granted, free of charge, to any per"
},
{
"path": "README.md",
"chars": 2405,
"preview": "<div>\n <img width=\"190\" height=\"210\" align=\"left\" src=\"https://raw.githubusercontent.com/v2fly/v2fly-github-io/master/d"
},
{
"path": "SECURITY.md",
"chars": 6257,
"preview": "# 安全策略 Security Policy\n\n## 受支持的版本 Supported Versions\n\n目前 v2ray-core 项目由 [V2Fly 社区](https://github.com/v2fly) 继续提供代码维护,由于"
},
{
"path": "annotations.go",
"chars": 680,
"preview": "package core\n\n// Annotation is a concept in V2Ray. This struct is only for documentation. It is not used anywhere.\n// An"
},
{
"path": "app/app.go",
"chars": 114,
"preview": "// Package app contains feature implementations of V2Ray. The features may be enabled during runtime.\npackage app\n"
},
{
"path": "app/browserforwarder/config.pb.go",
"chars": 4558,
"preview": "package browserforwarder\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org/"
},
{
"path": "app/browserforwarder/config.proto",
"chars": 599,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.browserforwarder;\n\noption csharp_namespace = \"V2Ray.Core.App.Browserforwarder"
},
{
"path": "app/browserforwarder/errors.generated.go",
"chars": 230,
"preview": "package browserforwarder\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc ne"
},
{
"path": "app/browserforwarder/forwarder.go",
"chars": 3351,
"preview": "package browserforwarder\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/v2fly/BrowserB"
},
{
"path": "app/commander/commander.go",
"chars": 3382,
"preview": "package commander\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n\nimport (\n\t\"context\"\n\t\"net"
},
{
"path": "app/commander/config.pb.go",
"chars": 7392,
"preview": "package commander\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org/protobu"
},
{
"path": "app/commander/config.proto",
"chars": 1098,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.commander;\noption csharp_namespace = \"V2Ray.Core.App.Commander\";\noption go_pa"
},
{
"path": "app/commander/errors.generated.go",
"chars": 223,
"preview": "package commander\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError("
},
{
"path": "app/commander/outbound.go",
"chars": 2420,
"preview": "package commander\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\t\"github.com/v2fly/v2ray-core/v5/common\"\n\t\"github.com/v2fly/v2ray-core/v"
},
{
"path": "app/commander/service.go",
"chars": 591,
"preview": "package commander\n\nimport (\n\t\"context\"\n\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/reflection\"\n\n\t\"github.com/v2f"
},
{
"path": "app/commander/webcommander/config.pb.go",
"chars": 5275,
"preview": "package webcommander\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org/prot"
},
{
"path": "app/commander/webcommander/config.proto",
"chars": 713,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.commander.webcommander;\noption csharp_namespace = \"V2Ray.Core.App.Commander.W"
},
{
"path": "app/commander/webcommander/errors.generated.go",
"chars": 226,
"preview": "package webcommander\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newErr"
},
{
"path": "app/commander/webcommander/webcommander.go",
"chars": 3288,
"preview": "package webcommander\n\nimport (\n\t\"archive/zip\"\n\t\"bytes\"\n\t\"context\"\n\t\"io/fs\"\n\t\"net/http\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"git"
},
{
"path": "app/dispatcher/config.pb.go",
"chars": 5084,
"preview": "package dispatcher\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.o"
},
{
"path": "app/dispatcher/config.proto",
"chars": 360,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.dispatcher;\noption csharp_namespace = \"V2Ray.Core.App.Dispatcher\";\noption go_"
},
{
"path": "app/dispatcher/default.go",
"chars": 9832,
"preview": "package dispatcher\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n\nimport (\n\t\"context\"\n\t\"st"
},
{
"path": "app/dispatcher/dispatcher.go",
"chars": 95,
"preview": "package dispatcher\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n"
},
{
"path": "app/dispatcher/errors.generated.go",
"chars": 224,
"preview": "package dispatcher\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError"
},
{
"path": "app/dispatcher/fakednssniffer.go",
"chars": 3865,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage dispatcher\n\nimport (\n\t\"context\"\n\t\"strings\"\n\n\tcore \"github.com/v2fly/v2"
},
{
"path": "app/dispatcher/sniffer.go",
"chars": 4163,
"preview": "package dispatcher\n\nimport (\n\t\"context\"\n\n\t\"github.com/v2fly/v2ray-core/v5/common\"\n\t\"github.com/v2fly/v2ray-core/v5/commo"
},
{
"path": "app/dispatcher/stats.go",
"chars": 529,
"preview": "package dispatcher\n\nimport (\n\t\"github.com/v2fly/v2ray-core/v5/common\"\n\t\"github.com/v2fly/v2ray-core/v5/common/buf\"\n\t\"git"
},
{
"path": "app/dispatcher/stats_test.go",
"chars": 833,
"preview": "package dispatcher_test\n\nimport (\n\t\"testing\"\n\n\t. \"github.com/v2fly/v2ray-core/v5/app/dispatcher\"\n\t\"github.com/v2fly/v2ra"
},
{
"path": "app/dns/config.go",
"chars": 2754,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage dns\n\nimport (\n\t\"golang.org/x/net/dns/dnsmessage\"\n\n\t\"github.com/v2fly/v"
},
{
"path": "app/dns/config.pb.go",
"chars": 49745,
"preview": "package dns\n\nimport (\n\tfakedns \"github.com/v2fly/v2ray-core/v5/app/dns/fakedns\"\n\troutercommon \"github.com/v2fly/v2ray-co"
},
{
"path": "app/dns/config.proto",
"chars": 5955,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.dns;\noption csharp_namespace = \"V2Ray.Core.App.Dns\";\noption go_package = \"git"
},
{
"path": "app/dns/dns.go",
"chars": 16065,
"preview": "//go:build !confonly\n// +build !confonly\n\n// Package dns is an implementation of core.DNS feature.\npackage dns\n\n//go:gen"
},
{
"path": "app/dns/dns_test.go",
"chars": 23820,
"preview": "package dns_test\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/miekg/dns\"\n\t\"google.golang.o"
},
{
"path": "app/dns/dnscommon.go",
"chars": 5453,
"preview": "package dns\n\nimport (\n\t\"encoding/binary\"\n\t\"strings\"\n\t\"time\"\n\n\t\"golang.org/x/net/dns/dnsmessage\"\n\n\t\"github.com/v2fly/v2ra"
},
{
"path": "app/dns/dnscommon_test.go",
"chars": 4482,
"preview": "package dns\n\nimport (\n\t\"math/rand\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/miekg/dns\"\n\t\"golang."
},
{
"path": "app/dns/errors.generated.go",
"chars": 217,
"preview": "package dns\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(values"
},
{
"path": "app/dns/fakedns/errors.generated.go",
"chars": 221,
"preview": "package fakedns\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(va"
},
{
"path": "app/dns/fakedns/fake.go",
"chars": 7385,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage fakedns\n\nimport (\n\t\"context\"\n\t\"math\"\n\t\"math/big\"\n\tgonet \"net\"\n\t\"sync\"\n"
},
{
"path": "app/dns/fakedns/fakedns.go",
"chars": 134,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage fakedns\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/er"
},
{
"path": "app/dns/fakedns/fakedns.pb.go",
"chars": 6059,
"preview": "package fakedns\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org/protobuf/"
},
{
"path": "app/dns/fakedns/fakedns.proto",
"chars": 855,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.dns.fakedns;\noption csharp_namespace = \"V2Ray.Core.App.Dns.Fakedns\";\noption g"
},
{
"path": "app/dns/fakedns/fakedns_test.go",
"chars": 8835,
"preview": "package fakedns\n\nimport (\n\tgonet \"net\"\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"golang.org/x/sync/"
},
{
"path": "app/dns/fakedns.go",
"chars": 2707,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage dns\n\nimport (\n\tfakedns \"github.com/v2fly/v2ray-core/v5/app/dns/fakedns"
},
{
"path": "app/dns/fakedns_test.go",
"chars": 7948,
"preview": "package dns_test\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/miekg/dns\"\n\t\"google.golang.o"
},
{
"path": "app/dns/hosts.go",
"chars": 3000,
"preview": "package dns\n\nimport (\n\t\"github.com/v2fly/v2ray-core/v5/common\"\n\t\"github.com/v2fly/v2ray-core/v5/common/net\"\n\t\"github.com"
},
{
"path": "app/dns/hosts_test.go",
"chars": 2541,
"preview": "package dns_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n\n\t. \"github.com/v2fly/v2ray-core/v5/app/dns\"\n\t\"gi"
},
{
"path": "app/dns/nameserver.go",
"chars": 7881,
"preview": "package dns\n\nimport (\n\t\"context\"\n\t\"net/url\"\n\t\"strings\"\n\t\"time\"\n\n\tcore \"github.com/v2fly/v2ray-core/v5\"\n\t\"github.com/v2fl"
},
{
"path": "app/dns/nameserver_doh.go",
"chars": 9400,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage dns\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n"
},
{
"path": "app/dns/nameserver_doh_test.go",
"chars": 1488,
"preview": "package dns_test\n\nimport (\n\t\"context\"\n\t\"net/url\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n\n\t. \"github.com/v2f"
},
{
"path": "app/dns/nameserver_fakedns.go",
"chars": 1587,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage dns\n\nimport (\n\t\"context\"\n\n\tcore \"github.com/v2fly/v2ray-core/v5\"\n\t\"git"
},
{
"path": "app/dns/nameserver_local.go",
"chars": 1405,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage dns\n\nimport (\n\t\"context\"\n\n\t\"github.com/v2fly/v2ray-core/v5/common/net\""
},
{
"path": "app/dns/nameserver_local_test.go",
"chars": 589,
"preview": "package dns_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t\"time\"\n\n\t. \"github.com/v2fly/v2ray-core/v5/app/dns\"\n\t\"github.com/v2fly"
},
{
"path": "app/dns/nameserver_quic.go",
"chars": 9716,
"preview": "package dns\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/binary\"\n\t\"net/url\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/quic-go/quic-go\"\n\t"
},
{
"path": "app/dns/nameserver_quic_test.go",
"chars": 1498,
"preview": "package dns_test\n\nimport (\n\t\"context\"\n\t\"net/url\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n\n\t. \"github.com/v2f"
},
{
"path": "app/dns/nameserver_tcp.go",
"chars": 8423,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage dns\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/binary\"\n\t\"net/url\"\n\t\"sync"
},
{
"path": "app/dns/nameserver_tcp_test.go",
"chars": 1508,
"preview": "package dns_test\n\nimport (\n\t\"context\"\n\t\"net/url\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n\n\t. \"github.com/v2f"
},
{
"path": "app/dns/nameserver_udp.go",
"chars": 7057,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage dns\n\nimport (\n\t\"context\"\n\t\"strings\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\""
},
{
"path": "app/instman/command/command.go",
"chars": 1618,
"preview": "package command\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\n\t\"google.golang.org/grpc\"\n\n\tcore \"github.com/v2fly/v2ray-core/v"
},
{
"path": "app/instman/command/command.pb.go",
"chars": 13273,
"preview": "package command\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org/protobuf/"
},
{
"path": "app/instman/command/command.proto",
"chars": 1023,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.instman.command;\noption csharp_namespace = \"V2Ray.Core.App.Instman.Command\";\n"
},
{
"path": "app/instman/command/command_grpc.pb.go",
"chars": 8414,
"preview": "package command\n\nimport (\n\tcontext \"context\"\n\tgrpc \"google.golang.org/grpc\"\n\tcodes \"google.golang.org/grpc/codes\"\n\tstatu"
},
{
"path": "app/instman/config.pb.go",
"chars": 3625,
"preview": "package instman\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org/protobuf/"
},
{
"path": "app/instman/config.proto",
"chars": 462,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.instman;\noption csharp_namespace = \"V2Ray.Core.App.Instman\";\noption go_packag"
},
{
"path": "app/instman/errors.generated.go",
"chars": 221,
"preview": "package instman\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(va"
},
{
"path": "app/instman/instman.go",
"chars": 2145,
"preview": "package instman\n\nimport (\n\t\"context\"\n\n\tcore \"github.com/v2fly/v2ray-core/v5\"\n\t\"github.com/v2fly/v2ray-core/v5/common\"\n\t\""
},
{
"path": "app/log/command/command.go",
"chars": 2057,
"preview": "package command\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n\nimport (\n\t\"context\"\n\n\tgrpc "
},
{
"path": "app/log/command/command_test.go",
"chars": 1003,
"preview": "package command_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"google.golang.org/protobuf/types/known/anypb\"\n\n\tcore \"github.com"
},
{
"path": "app/log/command/config.pb.go",
"chars": 9221,
"preview": "package command\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/"
},
{
"path": "app/log/command/config.proto",
"chars": 642,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.log.command;\noption csharp_namespace = \"V2Ray.Core.App.Log.Command\";\noption g"
},
{
"path": "app/log/command/config_grpc.pb.go",
"chars": 6608,
"preview": "package command\n\nimport (\n\tcontext \"context\"\n\tgrpc \"google.golang.org/grpc\"\n\tcodes \"google.golang.org/grpc/codes\"\n\tstatu"
},
{
"path": "app/log/command/errors.generated.go",
"chars": 221,
"preview": "package command\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(va"
},
{
"path": "app/log/config.pb.go",
"chars": 8041,
"preview": "package log\n\nimport (\n\tlog \"github.com/v2fly/v2ray-core/v5/common/log\"\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoex"
},
{
"path": "app/log/config.proto",
"chars": 742,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.log;\noption csharp_namespace = \"V2Ray.Core.App.Log\";\noption go_package = \"git"
},
{
"path": "app/log/errors.generated.go",
"chars": 217,
"preview": "package log\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(values"
},
{
"path": "app/log/log.go",
"chars": 3532,
"preview": "package log\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n\nimport (\n\t\"context\"\n\t\"reflect\"\n"
},
{
"path": "app/log/log_creator.go",
"chars": 1343,
"preview": "package log\n\nimport (\n\t\"github.com/v2fly/v2ray-core/v5/common\"\n\t\"github.com/v2fly/v2ray-core/v5/common/log\"\n)\n\ntype Hand"
},
{
"path": "app/log/log_test.go",
"chars": 1337,
"preview": "package log_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"github.com/golang/mock/gomock\"\n\n\t\"github.com/v2fly/v2ray-core/v5/app"
},
{
"path": "app/observatory/burst/burst.go",
"chars": 255,
"preview": "package burst\n\nimport (\n\t\"math\"\n\t\"time\"\n)\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n\nc"
},
{
"path": "app/observatory/burst/burstobserver.go",
"chars": 2831,
"preview": "package burst\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\t\"github.com/golang/protobuf/proto\"\n\n\tcore \"github.com/v2fly/v2ray-core/v5\"\n"
},
{
"path": "app/observatory/burst/config.pb.go",
"chars": 7577,
"preview": "package burst\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org/protobuf/re"
},
{
"path": "app/observatory/burst/config.proto",
"chars": 1145,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.observatory.burst;\noption csharp_namespace = \"V2Ray.Core.App.Observatory.Burs"
},
{
"path": "app/observatory/burst/errors.generated.go",
"chars": 219,
"preview": "package burst\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(valu"
},
{
"path": "app/observatory/burst/healthping.go",
"chars": 6234,
"preview": "package burst\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/v2fly/v2ray-core/v5/common/dice\"\n)\n\n/"
},
{
"path": "app/observatory/burst/healthping_result.go",
"chars": 3301,
"preview": "package burst\n\nimport (\n\t\"math\"\n\t\"time\"\n)\n\n// HealthPingStats is the statistics of HealthPingRTTS\ntype HealthPingStats s"
},
{
"path": "app/observatory/burst/healthping_result_test.go",
"chars": 2490,
"preview": "package burst_test\n\nimport (\n\t\"math\"\n\treflect \"reflect\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/v2fly/v2ray-core/v5/app/observa"
},
{
"path": "app/observatory/burst/ping.go",
"chars": 1706,
"preview": "package burst\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/v2fly/v2ray-core/v5/common/net\"\n\t\"github.com/v2fly/"
},
{
"path": "app/observatory/command/command.go",
"chars": 1987,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage command\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/er"
},
{
"path": "app/observatory/command/command.pb.go",
"chars": 7995,
"preview": "package command\n\nimport (\n\tobservatory \"github.com/v2fly/v2ray-core/v5/app/observatory\"\n\t_ \"github.com/v2fly/v2ray-core/"
},
{
"path": "app/observatory/command/command.proto",
"chars": 839,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.observatory.command;\noption csharp_namespace = \"V2Ray.Core.App.Observatory.Co"
},
{
"path": "app/observatory/command/command_grpc.pb.go",
"chars": 4852,
"preview": "package command\n\nimport (\n\tcontext \"context\"\n\tgrpc \"google.golang.org/grpc\"\n\tcodes \"google.golang.org/grpc/codes\"\n\tstatu"
},
{
"path": "app/observatory/command/errors.generated.go",
"chars": 221,
"preview": "package command\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(va"
},
{
"path": "app/observatory/config.pb.go",
"chars": 16738,
"preview": "package observatory\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org/proto"
},
{
"path": "app/observatory/config.proto",
"chars": 2235,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.observatory;\noption csharp_namespace = \"V2Ray.Core.App.Observatory\";\noption g"
},
{
"path": "app/observatory/errors.generated.go",
"chars": 225,
"preview": "package observatory\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newErro"
},
{
"path": "app/observatory/explainErrors.go",
"chars": 570,
"preview": "package observatory\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errorCollector struct {\n\terrors *errors"
},
{
"path": "app/observatory/multiobservatory/config.pb.go",
"chars": 4965,
"preview": "package multiobservatory\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\ttaggedfeatures \"github.com/v2fly"
},
{
"path": "app/observatory/multiobservatory/config.proto",
"chars": 659,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.observatory.multiobservatory;\noption csharp_namespace = \"V2Ray.Core.App.Obser"
},
{
"path": "app/observatory/multiobservatory/multi.go",
"chars": 1330,
"preview": "package multiobservatory\n\nimport (\n\t\"context\"\n\n\t\"github.com/golang/protobuf/jsonpb\"\n\t\"github.com/golang/protobuf/proto\"\n"
},
{
"path": "app/observatory/observatory.go",
"chars": 96,
"preview": "package observatory\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n"
},
{
"path": "app/observatory/observer.go",
"chars": 7587,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage observatory\n\nimport (\n\t\"context\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"sort\""
},
{
"path": "app/persistentstorage/filesystemstorage/config.pb.go",
"chars": 7280,
"preview": "package filesystemstorage\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org"
},
{
"path": "app/persistentstorage/filesystemstorage/config.proto",
"chars": 718,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.persistentstorage.filesystemstorage;\noption csharp_namespace = \"V2Ray.Core.Ap"
},
{
"path": "app/persistentstorage/filesystemstorage/fs.go",
"chars": 3727,
"preview": "package filesystemstorage\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"io\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"google.golang.org/protobuf/"
},
{
"path": "app/persistentstorage/protostorage/protokv.go",
"chars": 1256,
"preview": "package protostorage\n\nimport (\n\t\"context\"\n\n\t\"google.golang.org/protobuf/encoding/protojson\"\n\t\"google.golang.org/protobuf"
},
{
"path": "app/persistentstorage/storage.go",
"chars": 158,
"preview": "package persistentstorage\n\nimport \"github.com/v2fly/v2ray-core/v5/features/extension/storage\"\n\ntype ScopedPersistentStor"
},
{
"path": "app/policy/config.go",
"chars": 2575,
"preview": "package policy\n\nimport (\n\t\"time\"\n\n\t\"github.com/v2fly/v2ray-core/v5/features/policy\"\n)\n\n// Duration converts Second to ti"
},
{
"path": "app/policy/config.pb.go",
"chars": 18427,
"preview": "package policy\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org/protobuf/r"
},
{
"path": "app/policy/config.proto",
"chars": 1285,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.policy;\noption csharp_namespace = \"V2Ray.Core.App.Policy\";\noption go_package "
},
{
"path": "app/policy/errors.generated.go",
"chars": 220,
"preview": "package policy\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(val"
},
{
"path": "app/policy/manager.go",
"chars": 1443,
"preview": "package policy\n\nimport (\n\t\"context\"\n\n\t\"github.com/v2fly/v2ray-core/v5/common\"\n\t\"github.com/v2fly/v2ray-core/v5/features/"
},
{
"path": "app/policy/manager_test.go",
"chars": 1010,
"preview": "package policy_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t\"time\"\n\n\t. \"github.com/v2fly/v2ray-core/v5/app/policy\"\n\t\"github.com"
},
{
"path": "app/policy/policy.go",
"chars": 157,
"preview": "// Package policy is an implementation of policy.Manager feature.\npackage policy\n\n//go:generate go run github.com/v2fly/"
},
{
"path": "app/proxyman/command/command.go",
"chars": 4485,
"preview": "package command\n\nimport (\n\t\"context\"\n\n\tgrpc \"google.golang.org/grpc\"\n\n\tcore \"github.com/v2fly/v2ray-core/v5\"\n\t\"github.co"
},
{
"path": "app/proxyman/command/command.pb.go",
"chars": 26756,
"preview": "package command\n\nimport (\n\tv5 \"github.com/v2fly/v2ray-core/v5\"\n\tprotocol \"github.com/v2fly/v2ray-core/v5/common/protocol"
},
{
"path": "app/proxyman/command/command.proto",
"chars": 1835,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.proxyman.command;\noption csharp_namespace = \"V2Ray.Core.App.Proxyman.Command\""
},
{
"path": "app/proxyman/command/command_grpc.pb.go",
"chars": 12980,
"preview": "package command\n\nimport (\n\tcontext \"context\"\n\tgrpc \"google.golang.org/grpc\"\n\tcodes \"google.golang.org/grpc/codes\"\n\tstatu"
},
{
"path": "app/proxyman/command/doc.go",
"chars": 92,
"preview": "package command\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n"
},
{
"path": "app/proxyman/command/errors.generated.go",
"chars": 221,
"preview": "package command\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(va"
},
{
"path": "app/proxyman/config.go",
"chars": 758,
"preview": "package proxyman\n\nfunc (s *AllocationStrategy) GetConcurrencyValue() uint32 {\n\tif s == nil || s.Concurrency == nil {\n\t\tr"
},
{
"path": "app/proxyman/config.pb.go",
"chars": 31594,
"preview": "package proxyman\n\nimport (\n\tnet \"github.com/v2fly/v2ray-core/v5/common/net\"\n\tinternet \"github.com/v2fly/v2ray-core/v5/tr"
},
{
"path": "app/proxyman/config.proto",
"chars": 3052,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.proxyman;\noption csharp_namespace = \"V2Ray.Core.App.Proxyman\";\noption go_pack"
},
{
"path": "app/proxyman/inbound/always.go",
"chars": 5275,
"preview": "package inbound\n\nimport (\n\t\"context\"\n\n\tcore \"github.com/v2fly/v2ray-core/v5\"\n\t\"github.com/v2fly/v2ray-core/v5/app/proxym"
},
{
"path": "app/proxyman/inbound/dynamic.go",
"chars": 5513,
"preview": "package inbound\n\nimport (\n\t\"context\"\n\t\"sync\"\n\t\"time\"\n\n\tcore \"github.com/v2fly/v2ray-core/v5\"\n\t\"github.com/v2fly/v2ray-co"
},
{
"path": "app/proxyman/inbound/errors.generated.go",
"chars": 221,
"preview": "package inbound\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(va"
},
{
"path": "app/proxyman/inbound/inbound.go",
"chars": 4738,
"preview": "package inbound\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n\nimport (\n\t\"context\"\n\t\"sync\""
},
{
"path": "app/proxyman/inbound/worker.go",
"chars": 13446,
"preview": "package inbound\n\nimport (\n\t\"context\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/v2fly/v2ray-core/v5/app/proxyman\"\n\t\"gi"
},
{
"path": "app/proxyman/outbound/errors.generated.go",
"chars": 222,
"preview": "package outbound\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(v"
},
{
"path": "app/proxyman/outbound/handler.go",
"chars": 11156,
"preview": "package outbound\n\nimport (\n\t\"context\"\n\n\tcore \"github.com/v2fly/v2ray-core/v5\"\n\t\"github.com/v2fly/v2ray-core/v5/app/proxy"
},
{
"path": "app/proxyman/outbound/handler_test.go",
"chars": 3935,
"preview": "package outbound_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t_ \"unsafe\"\n\n\t\"google.golang.org/protobuf/types/known/anypb\"\n\n\tcor"
},
{
"path": "app/proxyman/outbound/outbound.go",
"chars": 4156,
"preview": "package outbound\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n\nimport (\n\t\"context\"\n\t\"stri"
},
{
"path": "app/restfulapi/config.go",
"chars": 276,
"preview": "package restfulapi\n\nimport (\n\t\"context\"\n\n\t\"github.com/v2fly/v2ray-core/v5/common\"\n)\n\nfunc init() {\n\tcommon.Must(common.R"
},
{
"path": "app/restfulapi/config.pb.go",
"chars": 4592,
"preview": "package restfulapi\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org/protob"
},
{
"path": "app/restfulapi/config.proto",
"chars": 538,
"preview": "syntax = \"proto3\";\n\npackage v2ray.app.restfulapi;\noption csharp_namespace = \"V2Ray.App.Restapi\";\noption go_package = \"gi"
},
{
"path": "app/restfulapi/errors.generated.go",
"chars": 224,
"preview": "package restfulapi\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError"
},
{
"path": "app/restfulapi/restful_api.go",
"chars": 2970,
"preview": "package restfulapi\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/go-chi/chi/v5\"\n\t\"github.com/go-chi/chi/v5/middleware\"\n"
},
{
"path": "app/restfulapi/service.go",
"chars": 1166,
"preview": "package restfulapi\n\nimport (\n\t\"context\"\n\t\"net\"\n\t\"sync\"\n\n\tcore \"github.com/v2fly/v2ray-core/v5\"\n\t\"github.com/v2fly/v2ray-"
},
{
"path": "app/restfulapi/service_test.go",
"chars": 287,
"preview": "package restfulapi\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestTypeReturnAnonymou"
},
{
"path": "app/reverse/bridge.go",
"chars": 4221,
"preview": "package reverse\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"google.golang.org/protobuf/proto\"\n\n\t\"github.com/v2fly/v2ray-core/v5/comm"
},
{
"path": "app/reverse/config.go",
"chars": 240,
"preview": "package reverse\n\nimport (\n\t\"crypto/rand\"\n\t\"io\"\n\n\t\"github.com/v2fly/v2ray-core/v5/common/dice\"\n)\n\nfunc (c *Control) FillI"
},
{
"path": "app/reverse/config.pb.go",
"chars": 10580,
"preview": "package reverse\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org/protobuf/"
},
{
"path": "app/reverse/config.proto",
"chars": 796,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.reverse;\noption csharp_namespace = \"V2Ray.Core.Proxy.Reverse\";\noption go_pack"
},
{
"path": "app/reverse/errors.generated.go",
"chars": 221,
"preview": "package reverse\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(va"
},
{
"path": "app/reverse/portal.go",
"chars": 5618,
"preview": "package reverse\n\nimport (\n\t\"context\"\n\t\"sync\"\n\t\"time\"\n\n\t\"google.golang.org/protobuf/proto\"\n\n\t\"github.com/v2fly/v2ray-core"
},
{
"path": "app/reverse/portal_test.go",
"chars": 406,
"preview": "package reverse_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/v2fly/v2ray-core/v5/app/reverse\"\n\t\"github.com/v2fly/v2ray-core/v"
},
{
"path": "app/reverse/reverse.go",
"chars": 2071,
"preview": "package reverse\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n\nimport (\n\t\"context\"\n\n\tcore "
},
{
"path": "app/router/balancing.go",
"chars": 2683,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage router\n\nimport (\n\t\"context\"\n\n\t\"github.com/v2fly/v2ray-core/v5/features"
},
{
"path": "app/router/balancing_override.go",
"chars": 882,
"preview": "package router\n\nimport (\n\tsync \"sync\"\n)\n\nfunc (r *Router) OverrideBalancer(balancer string, target string) error {\n\tvar "
},
{
"path": "app/router/command/command.go",
"chars": 3806,
"preview": "package command\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n\nimport (\n\t\"context\"\n\t\"time\""
},
{
"path": "app/router/command/command.pb.go",
"chars": 27354,
"preview": "package command\n\nimport (\n\tnet \"github.com/v2fly/v2ray-core/v5/common/net\"\n\t_ \"github.com/v2fly/v2ray-core/v5/common/pro"
},
{
"path": "app/router/command/command.proto",
"chars": 3400,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.router.command;\noption csharp_namespace = \"V2Ray.Core.App.Router.Command\";\nop"
},
{
"path": "app/router/command/command_grpc.pb.go",
"chars": 10436,
"preview": "package command\n\nimport (\n\tcontext \"context\"\n\tgrpc \"google.golang.org/grpc\"\n\tcodes \"google.golang.org/grpc/codes\"\n\tstatu"
},
{
"path": "app/router/command/command_test.go",
"chars": 10546,
"preview": "package command_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/golang/mock/gomock\"\n\t\"github.com/google/go-cm"
},
{
"path": "app/router/command/config.go",
"chars": 3694,
"preview": "package command\n\nimport (\n\t\"strings\"\n\n\t\"github.com/v2fly/v2ray-core/v5/common/net\"\n\t\"github.com/v2fly/v2ray-core/v5/feat"
},
{
"path": "app/router/command/errors.generated.go",
"chars": 221,
"preview": "package command\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(va"
},
{
"path": "app/router/condition.go",
"chars": 7024,
"preview": "package router\n\nimport (\n\t\"strings\"\n\n\t\"go.starlark.net/starlark\"\n\t\"go.starlark.net/syntax\"\n\n\t\"github.com/v2fly/v2ray-cor"
},
{
"path": "app/router/condition_geoip.go",
"chars": 2538,
"preview": "package router\n\nimport (\n\t\"net/netip\"\n\n\t\"go4.org/netipx\"\n\n\t\"github.com/v2fly/v2ray-core/v5/app/router/routercommon\"\n\t\"gi"
},
{
"path": "app/router/condition_geoip_test.go",
"chars": 5380,
"preview": "package router_test\n\nimport (\n\t\"errors\"\n\t\"io/fs\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"google.golang.org/proto"
},
{
"path": "app/router/condition_test.go",
"chars": 12876,
"preview": "package router_test\n\nimport (\n\t\"errors\"\n\t\"io/fs\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"google.golan"
},
{
"path": "app/router/config.go",
"chars": 5857,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage router\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\n\t\"github.com/golang/prot"
},
{
"path": "app/router/config.pb.go",
"chars": 39345,
"preview": "package router\n\nimport (\n\troutercommon \"github.com/v2fly/v2ray-core/v5/app/router/routercommon\"\n\tnet \"github.com/v2fly/v"
},
{
"path": "app/router/config.proto",
"chars": 5953,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.router;\noption csharp_namespace = \"V2Ray.Core.App.Router\";\noption go_package "
},
{
"path": "app/router/errors.generated.go",
"chars": 220,
"preview": "package router\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(val"
},
{
"path": "app/router/router.go",
"chars": 7048,
"preview": "package router\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n\nimport (\n\t\"context\"\n\n\tcore \""
},
{
"path": "app/router/router_test.go",
"chars": 6650,
"preview": "package router_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"github.com/golang/mock/gomock\"\n\n\t. \"github.com/v2fly/v2ray-core/v"
},
{
"path": "app/router/routercommon/common.pb.go",
"chars": 20062,
"preview": "package routercommon\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org/prot"
},
{
"path": "app/router/routercommon/common.proto",
"chars": 2046,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.router.routercommon;\noption csharp_namespace = \"V2Ray.Core.App.Router.Routerc"
},
{
"path": "app/router/strategy_leastload.go",
"chars": 6309,
"preview": "package router\n\nimport (\n\t\"context\"\n\t\"math\"\n\t\"sort\"\n\t\"time\"\n\n\t\"github.com/golang/protobuf/proto\"\n\n\tcore \"github.com/v2fl"
},
{
"path": "app/router/strategy_leastload_test.go",
"chars": 5214,
"preview": "package router\n\nimport (\n\t\"testing\"\n)\n\n/*\nSplit into multiple package, need to be tested separately\n\n\tfunc TestSelectLea"
},
{
"path": "app/router/strategy_leastping.go",
"chars": 2273,
"preview": "//go:build !confonly\n// +build !confonly\n\npackage router\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\tcore \"github.com/v2fly/v2ray-cor"
},
{
"path": "app/router/strategy_random.go",
"chars": 2547,
"preview": "package router\n\nimport (\n\t\"context\"\n\n\t\"google.golang.org/protobuf/runtime/protoiface\"\n\n\tcore \"github.com/v2fly/v2ray-cor"
},
{
"path": "app/router/weight.go",
"chars": 2022,
"preview": "package router\n\nimport (\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n)\n\ntype weightScaler func(value, weight float64) float6"
},
{
"path": "app/router/weight_test.go",
"chars": 1212,
"preview": "package router_test\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/v2fly/v2ray-core/v5/app/router\"\n)\n\nfunc TestWeight(t *"
},
{
"path": "app/stats/channel.go",
"chars": 4224,
"preview": "package stats\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\t\"github.com/v2fly/v2ray-core/v5/common\"\n)\n\n// Channel is an implementation "
},
{
"path": "app/stats/channel_test.go",
"chars": 9728,
"preview": "package stats_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\t. \"github.com/v2fly/v2ray-core/v5/app/stats\"\n\t\"githu"
},
{
"path": "app/stats/command/command.go",
"chars": 3178,
"preview": "package command\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n\nimport (\n\t\"context\"\n\t\"runti"
},
{
"path": "app/stats/command/command.pb.go",
"chars": 18200,
"preview": "package command\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org/protobuf/"
},
{
"path": "app/stats/command/command.proto",
"chars": 1477,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.stats.command;\noption csharp_namespace = \"V2Ray.Core.App.Stats.Command\";\nopti"
},
{
"path": "app/stats/command/command_grpc.pb.go",
"chars": 7569,
"preview": "package command\n\nimport (\n\tcontext \"context\"\n\tgrpc \"google.golang.org/grpc\"\n\tcodes \"google.golang.org/grpc/codes\"\n\tstatu"
},
{
"path": "app/stats/command/command_test.go",
"chars": 1891,
"preview": "package command_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/google/go-cmp/cmp/cmp"
},
{
"path": "app/stats/command/errors.generated.go",
"chars": 221,
"preview": "package command\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(va"
},
{
"path": "app/stats/config.pb.go",
"chars": 5476,
"preview": "package stats\n\nimport (\n\t_ \"github.com/v2fly/v2ray-core/v5/common/protoext\"\n\tprotoreflect \"google.golang.org/protobuf/re"
},
{
"path": "app/stats/config.proto",
"chars": 554,
"preview": "syntax = \"proto3\";\n\npackage v2ray.core.app.stats;\noption csharp_namespace = \"V2Ray.Core.App.Stats\";\noption go_package = "
},
{
"path": "app/stats/counter.go",
"chars": 478,
"preview": "package stats\n\nimport \"sync/atomic\"\n\n// Counter is an implementation of stats.Counter.\ntype Counter struct {\n\tvalue int6"
},
{
"path": "app/stats/counter_test.go",
"chars": 679,
"preview": "package stats_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t. \"github.com/v2fly/v2ray-core/v5/app/stats\"\n\t\"github.com/v2fly/v2r"
},
{
"path": "app/stats/errors.generated.go",
"chars": 219,
"preview": "package stats\n\nimport \"github.com/v2fly/v2ray-core/v5/common/errors\"\n\ntype errPathObjHolder struct{}\n\nfunc newError(valu"
},
{
"path": "app/stats/stats.go",
"chars": 3898,
"preview": "package stats\n\n//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n"
},
{
"path": "app/stats/stats_test.go",
"chars": 2019,
"preview": "package stats_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t\"time\"\n\n\t. \"github.com/v2fly/v2ray-core/v5/app/stats\"\n\t\"github.com/v"
}
]
// ... and 1166 more files (download for full content)
About this extraction
This page contains the full source code of the v2fly/v2ray-core GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1366 files (5.5 MB), approximately 1.5M tokens, and a symbol index with 9480 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.