SimpleChatTC:SimpleProxy: Include a sample config file

with allowed domains set to few sites in general to show its use

this includes some sites which allow search to be carried out
through them as well as provide news aggregation
This commit is contained in:
hanishkvc 2025-10-23 19:30:48 +05:30
parent 370326b1ec
commit 840cab0b1c
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,12 @@
{
"allowed.domains": [
"^www\\.bing\\.com$",
".*\\.yahoo\\.com$",
"^search\\.yahoo\\.com$",
".*\\.brave\\.com$",
"^search\\.brave\\.com$",
".*\\.duckduckgo\\.com$",
".*\\.google\\.com$",
"^google\\.com$"
]
}

View File

@ -108,6 +108,7 @@ def validate_url(url: str, tag: str):
Implement a re based filter logic on the specified url.
"""
urlParts = urllib.parse.urlparse(url)
print(f"DBUG:ValidateUrl:{urlParts}, {urlParts.hostname}")
urlHName = urlParts.hostname
if not urlHName:
return UrlReqResp(False, 400, f"WARN:{tag}:Missing hostname in Url")