Compare commits

..

No commits in common. "e581d947f873b96a91ff668829b1ad9e01f5f225" and "af7b38564157072603a8705866641b66c56a50ca" have entirely different histories.

4 changed files with 10 additions and 16 deletions

View File

@ -171,9 +171,9 @@ public class ContentFilter
{
html = HttpClientHelper.GetHtml(url1, 80).GetAwaiter().GetResult();
}
catch
catch (Exception e)
{
//
Console.WriteLine(e);
}
}
else
@ -184,9 +184,9 @@ public class ContentFilter
{
html = HttpClientHelper.GetHtml(url2, 443).GetAwaiter().GetResult();
}
catch
catch (Exception e)
{
//
Console.WriteLine(e);
}
}

View File

@ -59,7 +59,7 @@ public class ThreadHandler
{
Thread.Sleep(5000); // Let the database handler instantiate and warm up first.
List<WaitHandle[]> wait = _ipScanner.Start(32);
List<WaitHandle[]> wait = _ipScanner.Start(128);
for (int i = 0; i < wait.Count; i++)
{

View File

@ -1,9 +1,9 @@
using System.Diagnostics;
namespace Backend.Helper;
public static class HttpClientHelper
{
private const string UserAgentHeader = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36";
public static async Task<string> GetHtml(string url, int port)
{
using HttpClient client = new();
@ -18,8 +18,7 @@ public static class HttpClientHelper
}
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.UserAgent.ParseAdd(UserAgentHeader);
client.Timeout = TimeSpan.FromSeconds(30);
client.Timeout = TimeSpan.FromSeconds(1);
HttpResponseMessage? response;
@ -54,13 +53,12 @@ public static class HttpClientHelper
}
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.UserAgent.ParseAdd(UserAgentHeader);
client.Timeout = TimeSpan.FromSeconds(30);
client.Timeout = TimeSpan.FromSeconds(1);
HttpResponseMessage? response = null;
try
{
{//
response = await client.SendAsync(new(HttpMethod.Head, "/robots.txt"));
}
catch

View File

@ -7,7 +7,6 @@ const loading = ref<boolean>(true);
const error = ref<string | null>(null);
let dict = ref<ProgressDictionary[] | null>(null);
const fetchMyData = async () => {
try {
loading.value = true;
@ -22,7 +21,6 @@ const fetchMyData = async () => {
},
5 // Cache max age in seconds
);
} catch (err) {
error.value = (err as Error).message;
} finally {
@ -36,8 +34,6 @@ const fetchMyData = async () => {
fetchMyData();
</script>
<template>