1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00
v2fly/app/proxyman/config.proto

102 lines
2.9 KiB
Protocol Buffer
Raw Normal View History

2016-12-16 17:02:11 -05:00
syntax = "proto3";
package v2ray.core.app.proxyman;
2017-01-08 04:10:37 -05:00
option csharp_namespace = "V2Ray.Core.App.Proxyman";
option go_package = "github.com/v2fly/v2ray-core/v5/app/proxyman";
2016-12-16 17:02:11 -05:00
option java_package = "com.v2ray.core.app.proxyman";
2017-02-03 17:15:10 -05:00
option java_multiple_files = true;
2016-12-16 17:02:11 -05:00
import "common/net/address.proto";
import "common/net/port.proto";
import "transport/internet/config.proto";
import "google/protobuf/any.proto";
2017-01-14 18:17:06 -05:00
message InboundConfig {}
2017-04-02 08:24:10 -04:00
2017-01-14 18:17:06 -05:00
message AllocationStrategy {
enum Type {
// Always allocate all connection handlers.
Always = 0;
// Randomly allocate specific range of handlers.
Random = 1;
// External. Not supported yet.
External = 2;
}
Type type = 1;
message AllocationStrategyConcurrency {
uint32 value = 1;
}
// Number of handlers (ports) running in parallel.
// Default value is 3 if unset.
AllocationStrategyConcurrency concurrency = 2;
message AllocationStrategyRefresh {
uint32 value = 1;
}
// Number of minutes before a handler is regenerated.
// Default value is 5 if unset.
AllocationStrategyRefresh refresh = 3;
}
enum KnownProtocols {
HTTP = 0;
TLS = 1;
}
2018-07-16 07:47:00 -04:00
message SniffingConfig {
// Whether or not to enable content sniffing on an inbound connection.
bool enabled = 1;
2018-07-20 07:09:42 -04:00
// Override target destination if sniff'ed protocol is in the given list.
Feature: Fake DNS support (#406) * Add fake dns A new config object "fake" in DnsObject for toggling fake dns function Compare with sniffing, fake dns is not limited to http and tls traffic. It works across all inbounds. For example, when dns request come from one inbound, the local DNS server of v2ray will response with a unique fake IP for every unique domain name. Then later on v2ray received a request to one of the fake IP from any inbounds, it will override the request destination with the previously saved domain. By default, v2ray cache up to 65535 addresses. The old records will be discarded bases on LRU. The fake IP will be 240.x.x.x * fix an edge case when encounter a fake IP in use * Move lru to common.cache package * Added the necessary change to obtain request IP from sniffer * Refactor the code so that it may stop depending on global variables in the future. * Replace string manipulation code with more generic codes, hopefully this will work for both IPv4 and IPv6 networks. * Try to use IPv4 version of address if possible * Added Test Case for Fake Dns * Added More Test Case for Fake Dns * Stop user from creating a instance with LRU size more than subnet size, it will create a infinite loop * Move Fake DNS to a separate package * Generated Code for fakedns * Encapsulate Fake DNS as a Instance wide service * Added Support for metadata sniffer, which will be used for Fake DNS * Dependency injection for fake dns * Fake DNS As a Sniffer * Remove stub object * Remove global variable * Update generated protobuf file for metadata only sniffing * Apply Fake DNS config to session * Loading for fake dns settings * Bug fix * Include fake dns in all * Fix FakeDns Lint Condition * Fix sniffer config * Fix lint message * Fix dependency resolution * Fix fake dns not loaded as sniffer * reduce ttl for fake dns * Apply Coding Style * Apply Coding Style * Apply Coding Style * Apply Coding Style * Apply Coding Style * Fix crashed when no fake dns * Apply Coding Style * Fix Fake DNS do not apply to UDP socket * Fixed a bug prevent FakeDNS App Setting from become effective * Fixed a caveat prevent FakeDNS App Setting from become effective * Use log comparison to reduce in issue when it comes to really high value typical for ipv6 subnet * Add build tag for fakedns * Removal of FakeDNS specific logic at DNS client: making it a standard dns client * Regenerate auto generated file * Amended version of configure file * Bug fixes for fakeDNS * Bug fixes for fakeDNS * Fix test: remove reference to removed attribute * Test: fix codacy issue * Conf: Remove old field support * Test: fix codacy issue * Change test scale for TestFakeDnsHolderCreateMappingAndRollOver * Test: fix codacy issue Co-authored-by: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Co-authored-by: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Co-authored-by: kslr <kslrwang@gmail.com>
2021-02-08 05:18:52 -05:00
// Supported values are "http", "tls", "fakedns".
2018-07-20 07:09:42 -04:00
repeated string destination_override = 2;
Feature: Fake DNS support (#406) * Add fake dns A new config object "fake" in DnsObject for toggling fake dns function Compare with sniffing, fake dns is not limited to http and tls traffic. It works across all inbounds. For example, when dns request come from one inbound, the local DNS server of v2ray will response with a unique fake IP for every unique domain name. Then later on v2ray received a request to one of the fake IP from any inbounds, it will override the request destination with the previously saved domain. By default, v2ray cache up to 65535 addresses. The old records will be discarded bases on LRU. The fake IP will be 240.x.x.x * fix an edge case when encounter a fake IP in use * Move lru to common.cache package * Added the necessary change to obtain request IP from sniffer * Refactor the code so that it may stop depending on global variables in the future. * Replace string manipulation code with more generic codes, hopefully this will work for both IPv4 and IPv6 networks. * Try to use IPv4 version of address if possible * Added Test Case for Fake Dns * Added More Test Case for Fake Dns * Stop user from creating a instance with LRU size more than subnet size, it will create a infinite loop * Move Fake DNS to a separate package * Generated Code for fakedns * Encapsulate Fake DNS as a Instance wide service * Added Support for metadata sniffer, which will be used for Fake DNS * Dependency injection for fake dns * Fake DNS As a Sniffer * Remove stub object * Remove global variable * Update generated protobuf file for metadata only sniffing * Apply Fake DNS config to session * Loading for fake dns settings * Bug fix * Include fake dns in all * Fix FakeDns Lint Condition * Fix sniffer config * Fix lint message * Fix dependency resolution * Fix fake dns not loaded as sniffer * reduce ttl for fake dns * Apply Coding Style * Apply Coding Style * Apply Coding Style * Apply Coding Style * Apply Coding Style * Fix crashed when no fake dns * Apply Coding Style * Fix Fake DNS do not apply to UDP socket * Fixed a bug prevent FakeDNS App Setting from become effective * Fixed a caveat prevent FakeDNS App Setting from become effective * Use log comparison to reduce in issue when it comes to really high value typical for ipv6 subnet * Add build tag for fakedns * Removal of FakeDNS specific logic at DNS client: making it a standard dns client * Regenerate auto generated file * Amended version of configure file * Bug fixes for fakeDNS * Bug fixes for fakeDNS * Fix test: remove reference to removed attribute * Test: fix codacy issue * Conf: Remove old field support * Test: fix codacy issue * Change test scale for TestFakeDnsHolderCreateMappingAndRollOver * Test: fix codacy issue Co-authored-by: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Co-authored-by: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Co-authored-by: kslr <kslrwang@gmail.com>
2021-02-08 05:18:52 -05:00
// Whether should only try to sniff metadata without waiting for client input.
// Can be used to support SMTP like protocol where server send the first message.
bool metadata_only = 3;
2018-07-16 07:47:00 -04:00
}
message ReceiverConfig {
2018-04-09 11:09:24 -04:00
// PortRange specifies the ports which the Receiver should listen on.
2017-01-14 18:17:06 -05:00
v2ray.core.common.net.PortRange port_range = 1;
2018-04-09 11:09:24 -04:00
// Listen specifies the IP address that the Receiver should listen on.
2017-01-14 18:17:06 -05:00
v2ray.core.common.net.IPOrDomain listen = 2;
AllocationStrategy allocation_strategy = 3;
v2ray.core.transport.internet.StreamConfig stream_settings = 4;
bool receive_original_destination = 5;
reserved 6;
2018-07-16 07:47:00 -04:00
// Override domains for the given protocol.
// Deprecated. Use sniffing_settings.
repeated KnownProtocols domain_override = 7 [deprecated = true];
SniffingConfig sniffing_settings = 8;
2017-01-14 18:17:06 -05:00
}
message InboundHandlerConfig {
string tag = 1;
2021-06-19 09:36:54 -04:00
google.protobuf.Any receiver_settings = 2;
google.protobuf.Any proxy_settings = 3;
}
message OutboundConfig {}
2017-01-14 18:17:06 -05:00
message SenderConfig {
2017-01-14 18:17:06 -05:00
// Send traffic through the given IP. Only IP is allowed.
v2ray.core.common.net.IPOrDomain via = 1;
v2ray.core.transport.internet.StreamConfig stream_settings = 2;
2017-01-14 18:48:37 -05:00
v2ray.core.transport.internet.ProxyConfig proxy_settings = 3;
2017-04-02 08:24:10 -04:00
MultiplexingConfig multiplex_settings = 4;
2017-01-14 18:17:06 -05:00
}
2017-02-03 17:09:24 -05:00
message MultiplexingConfig {
2017-04-12 04:40:21 -04:00
// Whether or not Mux is enabled.
2017-02-03 17:09:24 -05:00
bool enabled = 1;
2017-04-12 04:40:21 -04:00
// Max number of concurrent connections that one Mux connection can handle.
uint32 concurrency = 2;
2017-02-03 17:09:24 -05:00
}