syntax = "proto3";

package xray.proxy.freedom;
option csharp_namespace = "Xray.Proxy.Freedom";
option go_package = "github.com/xtls/xray-core/proxy/freedom";
option java_package = "com.xray.proxy.freedom";
option java_multiple_files = true;

import "common/protocol/server_spec.proto";
import "transport/internet/config.proto";
import "common/net/port.proto";
import "common/net/network.proto";
import "common/geodata/geodat.proto";

message DestinationOverride {
  xray.common.protocol.ServerEndpoint server = 1;
}

message Fragment {
  uint64 packets_from = 1;
  uint64 packets_to = 2;
  uint64 length_min = 3;
  uint64 length_max = 4;
  uint64 interval_min = 5;
  uint64 interval_max = 6;
  uint64 max_split_min = 7;
  uint64 max_split_max = 8;
}

message Noise {
  uint64 length_min = 1;
  uint64 length_max = 2;
  uint64 delay_min = 3;
  uint64 delay_max = 4;
  bytes packet = 5;
  string apply_to = 6;
}

message Range {
  uint64 min = 1;
  uint64 max = 2;
}

enum RuleAction {
  Allow = 0;
  Block = 1;
}

message FinalRuleConfig {
  RuleAction action = 1;
  repeated xray.common.net.Network networks = 2;
  xray.common.net.PortList port_list = 3;
  repeated xray.common.geodata.IPRule ip = 4;
  Range block_delay = 5;
}

message Config {
  xray.transport.internet.DomainStrategy domain_strategy = 1;
  DestinationOverride destination_override = 3;
  uint32 user_level = 4;
  Fragment fragment = 5;
  uint32 proxy_protocol = 6;
  repeated Noise noises = 7;
  repeated FinalRuleConfig final_rules = 8;
}
