server.dart 1014 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import 'package:json_annotation/json_annotation.dart';
  2. import 'package:speed_safe/app/server/server_base.dart';
  3. part 'server.g.dart';
  4. @JsonSerializable(includeIfNull: false)
  5. class ShadowsocksServer extends ServerBase {
  6. String password;
  7. String encryption;
  8. String? plugin;
  9. String? pluginOpts;
  10. ShadowsocksServer({
  11. required String protocol,
  12. required String address,
  13. required int port,
  14. required String remark,
  15. required this.password,
  16. required this.encryption,
  17. this.plugin,
  18. this.pluginOpts,
  19. }) : super(
  20. protocol: protocol,
  21. address: address,
  22. port: port,
  23. remark: remark,
  24. );
  25. factory ShadowsocksServer.defaults() => ShadowsocksServer(
  26. protocol: 'shadowsocks',
  27. address: '',
  28. port: 0,
  29. remark: '',
  30. password: '',
  31. encryption: 'aes-128-gcm',
  32. );
  33. factory ShadowsocksServer.fromJson(Map<String, dynamic> json) =>
  34. _$ShadowsocksServerFromJson(json);
  35. @override
  36. Map<String, dynamic> toJson() => _$ShadowsocksServerToJson(this);
  37. }