Пример #1
0
def socket_send_test_lines(lines):
  if not len(lines):
    lines = [
      '+x 10.254.1.1 http://www.example_1.com/newone.html',
      '+x 10.254.1.2 http://www.example_2.com/newone.html',
      '+x 10.254.1.3 http://www.example_3.com/newone.html',
      '+x 10.254.1.4 http://www.example_4.com/newone.html',
      '+x 10.254.1.5 http://www.example_5.com/newone.html',
      '+x 10.254.1.6 http://www.example_6.com/newone.html',
      '+x 10.254.1.7 http://www.example_7.com/newone.html',
      '+x 10.254.1.8 http://www.example_8.com/newone.html',
      '+x 10.254.1.9 http://www.example_9.com/newone.html',

      '-x 10.254.1.1 http://www.example_1.com/newone.html',
      '-x 10.254.1.2 http://www.example_2.com/newone.html',
      '-x 10.254.1.3 http://www.example_3.com/newone.html',
      '-x 10.254.1.4 http://www.example_4.com/newone.html',
      '-x 10.254.1.5 http://www.example_5.com/newone.html',
      '-x 10.254.1.6 http://www.example_6.com/newone.html',
      '-x 10.254.1.7 http://www.example_7.com/newone.html',
      '-x 10.254.1.8 http://www.example_8.com/newone.html',
      '-x 10.254.1.9 http://www.example_9.com/newone.html',
    ]
  send_lines(lines)
  print_out("socket_test...")
Пример #2
0
  def post(self):
    message = self.request.body
    print(message)
    jsonObject = json.loads(message)
    rules = []
    for target in jsonObject["targets"]:
      cmd = "-x " + target["ip"] + " " + target["url"]
      rules.append(cmd.strip().encode('utf-8'))
    send_lines(rules)

    self.set_header("Content-Type", "application/json")
    self.write('{"done":true}')
Пример #3
0
    def post(self):
        message = self.request.body
        print(message)
        jsonObject = json.loads(message)
        rules = []
        for target in jsonObject["targets"]:
            cmd = "-x " + target["ip"] + " " + target["url"]
            rules.append(cmd.strip().encode('utf-8'))
        send_lines(rules)

        self.set_header("Content-Type", "application/json")
        self.write('{"done":true}')