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

Commit 16d8470

Browse files
author
hugsy
committed
Merge branch 'dev'
2 parents 700fb2b + 490fbb6 commit 16d8470

24 files changed

+816
-488
lines changed

cmake/FindPolarSSL.cmake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ if(NOT ${POLARSSL_LIBRARIES})
2424
find_library(POLARSSL_LIBRARIES NAMES polarssl)
2525
endif()
2626

27-
find_package_handle_standard_args(POLARSSL REQUIRED_VARS
28-
POLARSSL_INCLUDE_DIR POLARSSL_LIBRARIES)
27+
find_package_handle_standard_args(POLARSSL REQUIRED_VARS POLARSSL_INCLUDE_DIR POLARSSL_LIBRARIES)
2928

30-
if(!POLARSSL_INCLUDE_DIR AND !POLARSSL_LIBRARIES)
31-
message(FATAL_ERROR "Cannot find PolarSSL library")
29+
if( ${POLARSSL_LIBRARIES-NOTFOUND} )
30+
message(FATAL_ERROR "Failed to get info from PolarSSL library, check your PolarSSL installation")
3231
set(POLARSSL_FOUND False)
3332
return()
3433
endif()

config.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#define CFG_RESPONSE_PLUGIN_FUNCTION "proxenet_response_hook" // default name for hooking response function
4040
#define CFG_DEFAULT_SSL_CLIENT_DOMAIN "*" // default domain to use the SSL client certificate (* means any)
4141
#define CFG_DEFAULT_INTERCEPT_PATTERN "*" // default pattern to intercept (all)
42+
#define CFG_CONTROL_SOCK_PATH "/tmp/proxenet-control-socket"
4243

4344

4445
/********************************************************************************

control-client.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22
# -*- coding: utf-8 -*-
33
# -*- mode: python -*-
44

5-
import argparse
6-
import socket
7-
import datetime
8-
import os
9-
import rlcompleter
10-
import readline
5+
import argparse, socket, datetime, os, json, rlcompleter, readline, pprint
116

127

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

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

2621
def now():
@@ -84,7 +79,19 @@ def recv_until(sock, pattern=">>> "):
8479
recv_until(cli)
8580
break
8681

87-
cmd = raw_input( recv_until(cli) )
82+
res = recv_until(cli)
83+
data, prompt = res[:-4], res[-4:]
84+
try:
85+
js = json.loads( data )
86+
for k,v in js.iteritems():
87+
if v.__class__.__name__ == "dict":
88+
print("{}".format(k))
89+
for a,b in v.iteritems(): print("\t{} -> {}".format(a,b))
90+
else:
91+
print("{} -> {}".format(k,v))
92+
except:
93+
print(data)
94+
cmd = raw_input( prompt )
8895
cli.send(cmd.strip()+"\n")
8996
if cmd.strip() == "quit":
9097
do_loop = False

0 commit comments

Comments
 (0)