Skip to content

Commit

Permalink
Merge pull request #560 from MortezaBashsiz/py-fix-ip6-win
Browse files Browse the repository at this point in the history
Update fronting domain and fix ipv6 bug in windwos
  • Loading branch information
MortezaBashsiz authored May 15, 2023
2 parents 0ec6f12 + 8a8db67 commit afb08d0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ Contributors names and contact info
* Added no-fronting option
* 1.3.17
* Improved the fronting test method (jafar method)
* 1.3.18
* changed fronting domain
* 1.3.19
* fixed a bug in xray config saving in windows. ":" is not allowed in windows file names

[python]: https://img.shields.io/badge/-Python-3776AB?logo=python&logoColor=white
[version]: https://img.shields.io/badge/Version-1.3.17-blue
[version]: https://img.shields.io/badge/Version-1.3.19-blue
6 changes: 3 additions & 3 deletions python/cfscanner/speedtest/fronting.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ def fronting_test(
"""
s = requests.Session()
s.get_adapter(
'https://').poolmanager.connection_pool_kw['server_hostname'] = "jafar.mashallah.gq"
'https://').poolmanager.connection_pool_kw['server_hostname'] = "jafar.jafarcloud.ml"
s.get_adapter(
'https://').poolmanager.connection_pool_kw['assert_hostname'] = "jafar.mashallah.gq"
'https://').poolmanager.connection_pool_kw['assert_hostname'] = "jafar.jafarcloud.ml"

try:
compatible_ip = f"[{ip}]" if ":" in ip else ip
r = s.get(
f"https://{compatible_ip}/__down?bytes=10",
timeout=timeout,
headers={"Host": "jafar.mashallah.gq"}
headers={"Host": "jafar.jafarcloud.ml"}
)
except requests.exceptions.Timeout as e:
return f"[bold red1]NO[/bold red1] [orange3]{ip:15s}[/orange3][yellow1] fronting timeout[/yellow1]"
Expand Down
2 changes: 1 addition & 1 deletion python/cfscanner/xray/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def create_proxy_config(
random_sni = f"{uuid.uuid4()}.{hostname}"
config = config.replace("RANDOMHOST", random_sni)

config_path = os.path.join(config_dir, f"config-{edge_ip}.json")
config_path = os.path.join(config_dir, f"config-{edge_ip.replace(':', '_')}.json")
with open(config_path, "w") as configFile:
configFile.write(config)

Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "cfscanner"
version = "1.3.17"
version = "1.3.19"
authors = [
{ name="tempookian", email="[email protected]" },
{ name="Morteza Bashsiz", email="[email protected]"}
Expand Down

0 comments on commit afb08d0

Please sign in to comment.