buildShadowsocksConfig static method
Build a Shadowsocks JSON config string.
Implementation
static String buildShadowsocksConfig({
required String address,
required int port,
required String password,
String method = 'aes-256-gcm',
}) {
return jsonEncode({
'log': {'loglevel': 'warning'},
'inbounds': [
{
'port': 10808,
'protocol': 'socks',
'settings': {'auth': 'noauth'},
},
],
'outbounds': [
{
'protocol': 'shadowsocks',
'settings': {
'servers': [
{
'address': address,
'port': port,
'method': method,
'password': password,
},
],
},
},
],
});
}