V2RayConfigBuilder.empty constructor
Start with a local SOCKS inbound and no outbound servers.
Add at least one outbound before building the configuration.
Implementation
factory V2RayConfigBuilder.empty({
int socksPort = 1080,
String listen = '127.0.0.1',
}) {
if (socksPort < 1 || socksPort > 65535) {
throw RangeError.range(socksPort, 1, 65535, 'socksPort');
}
return V2RayConfigBuilder._({
'log': {'loglevel': 'warning'},
'inbounds': [
{
'tag': 'in_proxy',
'listen': listen,
'port': socksPort,
'protocol': 'socks',
'settings': {'auth': 'noauth', 'udp': true},
}
],
'outbounds': <Map<String, dynamic>>[],
'routing': {
'domainStrategy': 'AsIs',
'rules': <Map<String, dynamic>>[],
},
});
}