FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
MBPython/MBPython/proxy.py at master · lochen88/MBPython · GitHub
lochen88
/
MBPython
Public
Notifications
You must be signed in to change notification settings
Fork
12
Star
62
Code
Issues
3
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
MBPython
/
MBPython
/
proxy.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (37 loc) · 1.23 KB
Breadcrumbs
MBPython
/
MBPython
/
proxy.py
Copy path
File metadata and controls
43 lines (37 loc) · 1.23 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# -*- coding:utf-8 -*-
from
ctypes
import
(
c_int
,
c_ushort
)
from
.
wkeStruct
import
wkeProxy
class
Proxy
():
def
__init__
(
self
,
miniblink
):
self
.
mb
=
miniblink
def
wkeSetProxy
(
self
,
ip
,
port
,
proxy_type
=
1
,
user
=
None
,
password
=
None
):
if
not
all
([
ip
,
port
]):
return
if
user
==
None
:
user
=
b''
else
:
user
=
user
.
encode
(
'utf8'
)
if
password
==
None
:
password
=
b''
else
:
password
=
password
.
encode
(
'utf8'
)
ip
=
ip
.
encode
(
'utf8'
)
port
=
int
(
port
)
proxy
=
wkeProxy
(
type
=
c_int
(
proxy_type
),
hostname
=
ip
,
port
=
c_ushort
(
port
),
username
=
user
,
password
=
password
)
self
.
mb
.
wkeSetProxy
(
proxy
)
def
wkeSetViewProxy
(
self
,
webview
,
ip
,
port
,
proxy_type
=
1
,
user
=
None
,
password
=
None
):
if
not
all
([
ip
,
port
]):
return
if
user
==
None
:
user
=
b''
else
:
user
=
user
.
encode
(
'utf8'
)
if
password
==
None
:
password
=
b''
else
:
password
=
password
.
encode
(
'utf8'
)
ip
=
ip
.
encode
(
'utf8'
)
port
=
int
(
port
)
proxy
=
wkeProxy
(
type
=
c_int
(
proxy_type
),
hostname
=
ip
,
port
=
c_ushort
(
port
),
username
=
user
,
password
=
password
)
self
.
mb
.
wkeSetViewProxy
(
webview
,
proxy
)
Back
|
FazBrowse Home
|
New Git URL