import
sys
import
locale
import
http.server
import
socketserver
import
flask,json
import
requests
from
flask.
globals
import
request
import
winHelp
import
hostsHelp
winHelp.winHelp.getPower()
server
=
flask.Flask(__name__)
server.config[
'SERVER_NAME'
]
=
'www.renbayouhua.com'
@server
.route(
'/'
)
def
index():
return
'Index Page'
@server
.route(
'/Service.asmx'
, methods
=
[
'GET'
,
'POST'
])
def
Service():
req
=
request
print
(req.headers)
print
(
str
( req.get_data()))
rep
=
requests.post(url
=
"http://121.40.173.95/Service.asmx"
,data
=
req.get_data(),headers
=
req.headers)
rep_Body
=
rep.text
print
(
"动作:"
,req.headers[
"Soapaction"
])
if
req.headers[
"Soapaction"
].find(
"http://tempuri.org/dengluxin"
)!
=
-
1
:
rep_Body
=
rep_Body.replace(
"-1000"
,
"1000"
)
print
(
"返回结果:"
,rep_Body)
return
rep_Body,rep.status_code,[(
"Content-Type"
,
"text/xml; charset=utf-8"
)]
if
__name__
=
=
'__main__'
:
print
(hostsHelp.writeHost([
"#renbaJihack"
,
"127.0.0.1 www.renbayouhua.com"
]))
server.run(port
=
80
,debug
=
True
)