Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
doudian-py
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiquan
doudian-py
Commits
ccb903a4
Commit
ccb903a4
authored
Aug 12, 2025
by
baiquan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(utils): 重新启用代理验证功能
- 恢复了之前注释掉的代理验证代码
parent
89054d69
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
utils/common.py
+10
-10
No files found.
utils/common.py
View file @
ccb903a4
...
@@ -20,17 +20,17 @@ def check_proxy(proxy_url):
...
@@ -20,17 +20,17 @@ def check_proxy(proxy_url):
"http"
:
proxy_url
,
"http"
:
proxy_url
,
"https"
:
proxy_url
"https"
:
proxy_url
}
}
return
proxies
# addr = urlparse(proxy_url).hostname
# try:
# test_res = requests.get('http://httpbin.org/ip', timeout=10, proxies=proxies).json()
# except Exception as e:
# raise ProxyConnectionError(f"{addr}-->代理验证失败-->{str(e)}")
# if test_res.get('origin', "") == addr:
# logger.debug(f"{addr}-->代理验证成功")
# return proxies
# return proxies
# else:
addr
=
urlparse
(
proxy_url
)
.
hostname
# raise ProxyConnectionError(f"{addr}-->代理验证失败")
try
:
test_res
=
requests
.
get
(
'http://httpbin.org/ip'
,
timeout
=
10
,
proxies
=
proxies
)
.
json
()
except
Exception
as
e
:
raise
ProxyConnectionError
(
f
"{addr}-->代理验证失败-->{str(e)}"
)
if
test_res
.
get
(
'origin'
,
""
)
==
addr
:
logger
.
debug
(
f
"{addr}-->代理验证成功"
)
return
proxies
else
:
raise
ProxyConnectionError
(
f
"{addr}-->代理验证失败"
)
def
encryptParamsId
(
login_subject_uid
,
user_identity_id
):
def
encryptParamsId
(
login_subject_uid
,
user_identity_id
):
e
=
{
e
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment