Skip to content
This repository has been archived by the owner on Jun 24, 2023. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
hugsy committed May 30, 2015
2 parents 700fb2b + 490fbb6 commit 16d8470
Show file tree
Hide file tree
Showing 24 changed files with 816 additions and 488 deletions.
7 changes: 3 additions & 4 deletions cmake/FindPolarSSL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ if(NOT ${POLARSSL_LIBRARIES})
find_library(POLARSSL_LIBRARIES NAMES polarssl)
endif()

find_package_handle_standard_args(POLARSSL REQUIRED_VARS
POLARSSL_INCLUDE_DIR POLARSSL_LIBRARIES)
find_package_handle_standard_args(POLARSSL REQUIRED_VARS POLARSSL_INCLUDE_DIR POLARSSL_LIBRARIES)

if(!POLARSSL_INCLUDE_DIR AND !POLARSSL_LIBRARIES)
message(FATAL_ERROR "Cannot find PolarSSL library")
if( ${POLARSSL_LIBRARIES-NOTFOUND} )
message(FATAL_ERROR "Failed to get info from PolarSSL library, check your PolarSSL installation")
set(POLARSSL_FOUND False)
return()
endif()
Expand Down
1 change: 1 addition & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#define CFG_RESPONSE_PLUGIN_FUNCTION "proxenet_response_hook" // default name for hooking response function
#define CFG_DEFAULT_SSL_CLIENT_DOMAIN "*" // default domain to use the SSL client certificate (* means any)
#define CFG_DEFAULT_INTERCEPT_PATTERN "*" // default pattern to intercept (all)
#define CFG_CONTROL_SOCK_PATH "/tmp/proxenet-control-socket"


/********************************************************************************
Expand Down
23 changes: 15 additions & 8 deletions control-client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
# -*- coding: utf-8 -*-
# -*- mode: python -*-

import argparse
import socket
import datetime
import os
import rlcompleter
import readline
import argparse, socket, datetime, os, json, rlcompleter, readline, pprint


__author__ = "hugsy"
Expand All @@ -20,7 +15,7 @@
syntax: {3} [options] args
""".format(__version__, __licence__, __author__, __file__)

# the socket path can be modified in control-server.h
# the socket path can be modified in config.h.in
PROXENET_SOCKET_PATH = "/tmp/proxenet-control-socket"

def now():
Expand Down Expand Up @@ -84,7 +79,19 @@ def recv_until(sock, pattern=">>> "):
recv_until(cli)
break

cmd = raw_input( recv_until(cli) )
res = recv_until(cli)
data, prompt = res[:-4], res[-4:]
try:
js = json.loads( data )
for k,v in js.iteritems():
if v.__class__.__name__ == "dict":
print("{}".format(k))
for a,b in v.iteritems(): print("\t{} -> {}".format(a,b))
else:
print("{} -> {}".format(k,v))
except:
print(data)
cmd = raw_input( prompt )
cli.send(cmd.strip()+"\n")
if cmd.strip() == "quit":
do_loop = False
Expand Down
Loading

0 comments on commit 16d8470

Please sign in to comment.