config.proto 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. syntax = "proto3";
  2. package xray.app.proxyman;
  3. option csharp_namespace = "Xray.App.Proxyman";
  4. option go_package = "github.com/xtls/xray-core/app/proxyman";
  5. option java_package = "com.xray.app.proxyman";
  6. option java_multiple_files = true;
  7. import "common/net/address.proto";
  8. import "common/net/port.proto";
  9. import "transport/internet/config.proto";
  10. import "common/serial/typed_message.proto";
  11. message InboundConfig {}
  12. message AllocationStrategy {
  13. enum Type {
  14. // Always allocate all connection handlers.
  15. Always = 0;
  16. // Randomly allocate specific range of handlers.
  17. Random = 1;
  18. // External. Not supported yet.
  19. External = 2;
  20. }
  21. Type type = 1;
  22. message AllocationStrategyConcurrency {
  23. uint32 value = 1;
  24. }
  25. // Number of handlers (ports) running in parallel.
  26. // Default value is 3 if unset.
  27. AllocationStrategyConcurrency concurrency = 2;
  28. message AllocationStrategyRefresh {
  29. uint32 value = 1;
  30. }
  31. // Number of minutes before a handler is regenerated.
  32. // Default value is 5 if unset.
  33. AllocationStrategyRefresh refresh = 3;
  34. }
  35. enum KnownProtocols {
  36. HTTP = 0;
  37. TLS = 1;
  38. }
  39. message SniffingConfig {
  40. // Whether or not to enable content sniffing on an inbound connection.
  41. bool enabled = 1;
  42. // Override target destination if sniff'ed protocol is in the given list.
  43. // Supported values are "http", "tls", "fakedns".
  44. repeated string destination_override = 2;
  45. repeated string domains_excluded = 3;
  46. // Whether should only try to sniff metadata without waiting for client input.
  47. // Can be used to support SMTP like protocol where server send the first message.
  48. bool metadata_only = 4;
  49. }
  50. message ReceiverConfig {
  51. // PortRange specifies the ports which the Receiver should listen on.
  52. xray.common.net.PortRange port_range = 1;
  53. // Listen specifies the IP address that the Receiver should listen on.
  54. xray.common.net.IPOrDomain listen = 2;
  55. AllocationStrategy allocation_strategy = 3;
  56. xray.transport.internet.StreamConfig stream_settings = 4;
  57. bool receive_original_destination = 5;
  58. reserved 6;
  59. // Override domains for the given protocol.
  60. // Deprecated. Use sniffing_settings.
  61. repeated KnownProtocols domain_override = 7 [deprecated = true];
  62. SniffingConfig sniffing_settings = 8;
  63. }
  64. message InboundHandlerConfig {
  65. string tag = 1;
  66. xray.common.serial.TypedMessage receiver_settings = 2;
  67. xray.common.serial.TypedMessage proxy_settings = 3;
  68. }
  69. message OutboundConfig {}
  70. message SenderConfig {
  71. // Send traffic through the given IP. Only IP is allowed.
  72. xray.common.net.IPOrDomain via = 1;
  73. xray.transport.internet.StreamConfig stream_settings = 2;
  74. xray.transport.internet.ProxyConfig proxy_settings = 3;
  75. MultiplexingConfig multiplex_settings = 4;
  76. }
  77. message MultiplexingConfig {
  78. // Whether or not Mux is enabled.
  79. bool enabled = 1;
  80. // Max number of concurrent connections that one Mux connection can handle.
  81. uint32 concurrency = 2;
  82. }