diff --git a/Backend/Handler/Communication.cs b/Backend/Handler/Communication.cs index 6086039..a9aebb1 100644 --- a/Backend/Handler/Communication.cs +++ b/Backend/Handler/Communication.cs @@ -43,6 +43,8 @@ public class Communication { using ResponseSocket rep = new(); + //rep.Options.IPv4Only = true; + rep.Bind("tcp://127.0.0.1:5556"); while (_isRunning) @@ -51,6 +53,8 @@ public class Communication CommunicationObject? communicationObject = JsonSerializer.Deserialize(message); + rep.SendFrame(JsonSerializer.SerializeToUtf8Bytes("Success")); + if (communicationObject is null) { continue; @@ -134,12 +138,7 @@ public class Communication case CommunicationCommand.ChangeRuntimeVariable: { - Console.WriteLine("lmao"); - - if (string.IsNullOrWhiteSpace(communicationObject.VariableValue)) - { - break; - } + if (string.IsNullOrWhiteSpace(communicationObject.VariableValue)) break; if (communicationObject.Variable == RuntimeVariable.DbContent.ToString()) { @@ -152,13 +151,13 @@ public class Communication int value = int.Parse(communicationObject.VariableValue); _dbHandler.SetDiscardedWaitTime(value); } - + if (communicationObject.Variable == RuntimeVariable.ScannerTimeout.ToString()) { int value = int.Parse(communicationObject.VariableValue); _ipScanner.SetTimeout(value); } - + if (communicationObject.Variable == RuntimeVariable.ContentFilter.ToString()) { int value = int.Parse(communicationObject.VariableValue); diff --git a/Backend/Handler/ContentFilter.cs b/Backend/Handler/ContentFilter.cs index f5be79d..0be4d0e 100644 --- a/Backend/Handler/ContentFilter.cs +++ b/Backend/Handler/ContentFilter.cs @@ -25,8 +25,10 @@ public class ContentFilter _getDomainPort80 = $"{basePath}/Backend/Scripts/GetDomainNamePort80.sh"; _getDomainPort443 = $"{basePath}/Backend/Scripts/GetDomainNamePort443.sh"; + + SetTimeout(60000); } - + public void SetTimeout(int timeOut) { _timeOut = timeOut; diff --git a/Backend/Handler/IpScanner.cs b/Backend/Handler/IpScanner.cs index 32fb10a..1614fc5 100644 --- a/Backend/Handler/IpScanner.cs +++ b/Backend/Handler/IpScanner.cs @@ -1,5 +1,4 @@ using System.Collections.Concurrent; -using System.Globalization; using System.Net; using System.Net.NetworkInformation; using Backend.Helper; @@ -35,7 +34,6 @@ public class IpScanner public void SetTimeout(int milliseconds) { - Console.WriteLine($"Setting timeout to {milliseconds}ms"); _timeout = milliseconds; } diff --git a/Backend/Handler/ThreadHandler.cs b/Backend/Handler/ThreadHandler.cs index f742acb..9267459 100644 --- a/Backend/Handler/ThreadHandler.cs +++ b/Backend/Handler/ThreadHandler.cs @@ -97,7 +97,7 @@ public class ThreadHandler Stop(); } - + private void Stop() { _ipScanner.Stop(); diff --git a/Manager/Commands.cs b/Manager/Commands.cs index 9837684..abccd18 100644 --- a/Manager/Commands.cs +++ b/Manager/Commands.cs @@ -60,7 +60,7 @@ public static class Commands VariableValue = value }; - SendAndRecieveStringMessage(communicationObject); + Console.WriteLine(SendAndRecieveStringMessage(communicationObject)); } public static void GetHelp() @@ -113,7 +113,6 @@ public static class Commands byte[] lol = JsonSerializer.SerializeToUtf8Bytes(communicationObject); - using RequestSocket client = new(); client.Connect("tcp://127.0.0.1:5556"); client.SendFrame(lol); diff --git a/Manager/Program.cs b/Manager/Program.cs index abd960a..787506a 100644 --- a/Manager/Program.cs +++ b/Manager/Program.cs @@ -39,7 +39,10 @@ do else if (string.Equals(input, "R")) { + Console.WriteLine("Variable name."); string? variable = Console.ReadLine(); + + Console.WriteLine("Variable value."); string? value = Console.ReadLine(); if (string.IsNullOrWhiteSpace(variable) || string.IsNullOrWhiteSpace(value)) diff --git a/Models/Filtered.db b/Models/Filtered.db new file mode 100644 index 0000000..48380b1 Binary files /dev/null and b/Models/Filtered.db differ diff --git a/Models/ScannerResume.db b/Models/ScannerResume.db new file mode 100644 index 0000000..a44725c Binary files /dev/null and b/Models/ScannerResume.db differ diff --git a/Models/mydb.db b/Models/mydb.db new file mode 100644 index 0000000..8ad61fd Binary files /dev/null and b/Models/mydb.db differ diff --git a/Proxy/Program.cs b/Proxy/Program.cs index ae00150..d7e00e2 100644 --- a/Proxy/Program.cs +++ b/Proxy/Program.cs @@ -31,7 +31,7 @@ progressApi.MapGet("/", () => { Command = CommunicationCommand.GetScanningProgress }; - + byte[] bytes = JsonSerializer.SerializeToUtf8Bytes(communicationObject); using RequestSocket client = new(); @@ -50,7 +50,7 @@ searchApi.MapGet("/{term}", (string term) => CommunicationObject communicationObject = new(); communicationObject.Command = CommunicationCommand.GetSearches; communicationObject.SearchTerm = term; - + byte[] bytes = JsonSerializer.SerializeToUtf8Bytes(communicationObject); using RequestSocket client = new(); diff --git a/RSE.sln.DotSettings.user b/RSE.sln.DotSettings.user index 8248f74..d2fb5c5 100644 --- a/RSE.sln.DotSettings.user +++ b/RSE.sln.DotSettings.user @@ -20,6 +20,7 @@ ForceIncluded ForceIncluded ForceIncluded + ForceIncluded ForceIncluded ForceIncluded ForceIncluded