FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
mitmproxy/mitmproxy_http at master · stackpivot/mitmproxy · GitHub
stackpivot
/
mitmproxy
Public
Notifications
You must be signed in to change notification settings
Fork
10
Star
1
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
mitmproxy
/
mitmproxy_http
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
53 lines (42 loc) · 1.23 KB
Breadcrumbs
mitmproxy
/
mitmproxy_http
Copy path
File metadata and controls
executable file
·
53 lines (42 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
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python2
'''
HTTP interceptor and logger.
See --help for usage, README.md for solutions to common problems.
'''
from
twisted
.
internet
import
reactor
import
sys
import
mitmproxy
# disable reporting of bogus "no-member" errors
# pylint: disable=E1101
class
ProxyServer
(
mitmproxy
.
ProxyServer
):
'''
ProxyServer with implemented connect procedure
'''
def
connect_to_server
(
self
):
'''
Connect over raw TCP
'''
factory
=
mitmproxy
.
ProxyClientFactory
(
self
.
transmit
,
self
.
receive
,
self
.
log
)
reactor
.
connectTCP
(
self
.
host
,
self
.
port
,
factory
)
def
main
():
'''
Parse options, open log and start proxy server
'''
(
opts
,
_
)
=
mitmproxy
.
proxy_option_parser
(
80
,
8080
)
log
=
mitmproxy
.
Logger
()
if
opts
.
logfile
is
not
None
:
log
.
open_log
(
opts
.
logfile
)
sys
.
stderr
.
write
(
'Server running on localhost:%d...
\n
'
%
opts
.
localport
)
factory
=
mitmproxy
.
ProxyServerFactory
(
ProxyServer
,
opts
.
host
,
opts
.
port
,
log
)
reactor
.
listenTCP
(
opts
.
localport
,
factory
)
reactor
.
run
()
sys
.
exit
(
mitmproxy
.
exit_code
.
pop
())
if
__name__
==
"__main__"
:
try
:
main
()
except
KeyboardInterrupt
:
sys
.
exit
(
0
)
Back
|
FazBrowse Home
|
New Git URL