Browse files

numerous bugfixes

  • Loading branch information...
1 parent 6c14c51 commit 93080dd81ac8d80325e8cb56cb3042c235cb9226 @mhils committed Jan 8, 2013
View
2 gui/css/style.css
@@ -1 +1 @@
-*{-moz-box-sizing:border-box;box-sizing:border-box}.dijitContentPane,.dijitBorderContainerNoGutterPane,.dijitTooltip,.dijitTabPaneWrapper,.CodeMirror .CodeMirror-scroll{-moz-box-sizing:content-box;box-sizing:content-box}.claro .dijitContentPane{padding:0}.claro .dijitTabPaneWrapper{overflow:auto}.claro .dijitTabContainerTop-tabs .dijitTab,.claro .dijitTabContainerTop-tabs .dijitTabChecked{padding-top:0;padding-bottom:0}.claro .dijitTabContainerTop-tabs .dijitTabChecked{padding-bottom:1px}html,body{margin:0;padding:0;overflow:hidden;font-family:'Lucida Grande',sans-serif;font-size:12px;height:100%;width:100%}#appLayout{height:100%;width:100%}.hidden{display:none!important;visibility:hidden}@font-face{font-family:'Cantora One';font-style:normal;font-weight:400;src:local('Cantora One'),local('CantoraOne-Regular'),url(CantoraOne-Regular.woff) format('woff'),url(CantoraOne-Regular.ttf) format('truetype')}h3{font-family:'Cantora One',sans-serif;font-size:20px;font-weight:normal;margin-top:.7em}header{overflow:auto;display:block;height:64px;padding:0 10px;background-color:#f2f2f2;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#fff),color-stop(100% #f2f2f2));background-image:-webkit-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:-moz-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:-ms-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:-o-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:linear-gradient(top,#fff 0,#f2f2f2 100%);border-bottom:solid #454545 1px}header h3{margin:0;line-height:58.18181818181818px;float:left}header .mainToolbar.dijitToolbar{float:left;margin-top:20px;margin-left:30px;background:0;border:0}header a{line-height:12px;font-size:12px;float:right;color:black;margin-right:30px;margin-top:26px;text-decoration:none}header a:before{content:"["}header a:after{content:"]"}header img{margin-left:10px;margin-right:15px;float:left}#detail{min-height:200px;height:40%}.detailPane .dijitTabPane{padding:1px 10px 20px}.searchbox{width:100%}.searchbox input[type=text]{width:100%}#trafficPane{border-right:solid #ccc 1px;border-bottom:solid #ccc 1px}.sidebar{padding:20px;border-left:solid #ccc 1px;background-color:#f7f7f7;min-width:200px;width:100%;height:100%;overflow-y:auto}#tutorial{position:absolute;top:94px;left:30px}.filter-hide{display:none}.filters .filter-highlight-1{background-color:rgba(255,0,0,0.2)}.search.highlight-1{box-shadow:-6px 0 0 0 #f00}.filters .filter-highlight-2{background-color:rgba(255,217,0,0.2)}.search.highlight-2{box-shadow:-6px 0 0 0 #ffd900}.filters .filter-highlight-3{background-color:rgba(0,128,0,0.2)}.search.highlight-3{box-shadow:-6px 0 0 0 #008000}.filters{margin-top:-2px;position:absolute;left:0;right:0;width:100%;height:36px;display:-webkit-box;-webkit-box-orient:horizontal;z-index:-1}.search.highlight{padding:2px;border:solid #cfcfcf 1px;border-left:none}.filters .filter-highlight{height:100%;-webkit-box-flex:1;box-flex:1}.table-fixed-header{width:100%;height:100%}.table-fixed-header table{table-layout:fixed;border-spacing:0;border-collapse:collapse;width:100%}.table-fixed-header .scroll{position:absolute;top:25px;left:0;right:0;bottom:0;overflow-y:overlay;overflow-x:hidden}.table-fixed-header .header tr{height:24px}.table-fixed-header .data td{height:36px;padding:2px 0 0;vertical-align:top;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.table-fixed-header .data td *{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.table-fixed-header .data{background-color:rgba(0,0,0,0.07);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,transparent),color-stop(50% transparent),color-stop(50% rgba(0,0,0,0.05)),color-stop(100% rgba(0,0,0,0.05)));background-image:-webkit-linear-gradient(top,transparent 0,transparent 50%,rgba(0,0,0,0.05) 50%,rgba(0,0,0,0.05) 100%);background-image:-moz-linear-gradient(top,transparent 0,transparent 50%,rgba(0,0,0,0.05) 50%,rgba(0,0,0,0.05) 100%);background-image:-ms-linear-gradient(top,transparent 0,transparent 50%,rgba(0,0,0,0.05) 50%,rgba(0,0,0,0.05) 100%);background-image:-o-linear-gradient(top,transparent 0,transparent 50%,rgba(0,0,0,0.05) 50%,rgba(0,0,0,0.05) 100%);background-image:linear-gradient(top,transparent 0,transparent 50%,rgba(0,0,0,0.05) 50%,rgba(0,0,0,0.05) 100%);background-size:1px 72px}.table-fixed-header .data tr.selected{background-color:rgba(255,244,122,0.1)}.table-fixed-header .header{background-color:#ededed;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ededed),color-stop(100% #d9d9d9));background-image:-webkit-linear-gradient(top,#ededed 0,#d9d9d9 100%);background-image:-moz-linear-gradient(top,#ededed 0,#d9d9d9 100%);background-image:-ms-linear-gradient(top,#ededed 0,#d9d9d9 100%);background-image:-o-linear-gradient(top,#ededed 0,#d9d9d9 100%);background-image:linear-gradient(top,#ededed 0,#d9d9d9 100%)}.table-fixed-header .header th{border-bottom:1px solid #a3a3a3}.table-fixed-header .header th{text-align:left;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.table-fixed-header th:last-child,.table-fixed-header td:last-child{padding-right:30px}#trafficTable{min-width:600px}#trafficTable .data thead{display:none!important;visibility:hidden}#trafficTable th.goog-tablesorter-sorted{background-color:rgba(70,185,72,0.3)}#trafficTable th.goog-tablesorter-sorted-reverse{background-color:rgba(238,68,17,0.3)}#trafficTable .size,#trafficTable .time{text-align:right}#trafficTable .subtitle{font-size:11px;color:grey}#trafficTable .time .duration{color:grey}#trafficTable .request-scheme-https .ssl{background-color:rgba(66,212,43,0.4)}#trafficTable th,#trafficTable td{cursor:pointer}col.ssl,th.ssl{width:1%}col.name,th.name{width:41.5%}col.method,col.status,th.method,th.status{width:7.5%}col.type,th.type{width:12.5%}col.size,th.size{width:10%}col.time,th.time{width:20%}#trafficTable .icon{float:left;width:32px;height:32px;margin-right:3px;background-image:url(../images/resourcePlainIcon.png)}#trafficTable .category-document .icon{background-image:url(../images/resourceDocumentIcon.png)}#trafficTable .category-image .icon{background-image:url(../images/resourceImageIcon.png)}#trafficTable .category-css .icon{background-image:url(../images/resourceCSSIcon.png)}#trafficTable .category-js .icon{background-image:url(../images/resourceJSIcon.png)}pre.preview{white-space:pre-wrap;overflow-wrap:break-word;padding:1em!important;background-color:#f0f0f0}.prettyprint ol.linenums li{list-style-type:decimal}.pre-menu-item{float:right;background-color:white;border-bottom-left-radius:5px;padding:3px 5px;margin:1px;cursor:pointer;position:relative;transition:all .1s linear}.pre-menu-item:hover{background-color:#fff47a}dl{cursor:default;font-size:11px;margin:0;width:100%}dd,dt{width:50%;margin:0;display:inline-block}dd{padding-left:8px;text-align:left}dt{font-weight:bold;text-align:right;color:#4d4d4d}.preview-image img{display:block;margin:0 auto 10px}.flowlist li{cursor:pointer}pre.raw{padding:1em;background-color:#f0f0f0;overflow-x:scroll}.button{min-width:16px;min-height:16px;display:inline-block;cursor:pointer;background-repeat:no-repeat;color:#0050c7;text-decoration:none}.button-text{padding-left:20px;line-height:16px}.button-topright{float:right;margin-left:10px}.button-popout{background-image:url(../images/window-new.png)}.button-similar{background-image:url(../images/search-similar.png)}.button-download{background-image:url(../images/document-save.png)}#detail{font-size:11px}.headers{table-layout:fixed;width:100%}.headers td,.headers td *:not(pre){white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.headers tr td:first-child{width:300px}.headers td{padding:0;vertical-align:top}.headers tr td:first-child{color:#545454;font-weight:bold;width:200px;overflow:hidden}.headers tr td:first-child.title{color:black;padding:0 0 3px}.headers .header-value{font-family:Consolas,Lucida Console,monospace}.detailPane .dijitTabListWrapper{background-color:#f2f2f2;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#fff),color-stop(100% #f2f2f2));background-image:-webkit-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:-moz-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:-ms-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:-o-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:linear-gradient(top,#fff 0,#f2f2f2 100%)}ul.checksums{list-style-type:none;padding-left:0;margin:0}ul.checksums .value{font-style:italic;font-family:Consolas,Lucida Console,monospace}.reportOutput{overflow:auto;width:100%;height:100%;padding:15px;border-right:solid #ccc 1px;border-bottom:solid #ccc 1px}#reportEditor{width:50%}.CodeMirror{background-color:white;height:auto}span.CodeMirror-matchhighlight{background:#e9e9e9}.CodeMirror-focused span.CodeMirror-matchhighlight{background:#e7e4ff!important}.reportEditorToolbar{overflow:auto}.editor-loadselect{float:right;margin-top:1px;margin-bottom:0}.editor-status{display:inline-block;color:gray;line-height:100%;font-size:.9em}
+*{-moz-box-sizing:border-box;box-sizing:border-box}.dijitContentPane,.dijitBorderContainerNoGutterPane,.dijitTooltip,.dijitTabPaneWrapper,.CodeMirror .CodeMirror-scroll{-moz-box-sizing:content-box;box-sizing:content-box}.claro .dijitContentPane{padding:0}.claro .dijitStackContainer-child{height:100%}.claro .dijitTabPaneWrapper{overflow:auto}.claro .dijitTabContainerTop-tabs .dijitTab,.claro .dijitTabContainerTop-tabs .dijitTabChecked{padding-top:0;padding-bottom:0}.claro .dijitTabContainerTop-tabs .dijitTabChecked{padding-bottom:1px}html,body{margin:0;padding:0;overflow:hidden;font-family:'Lucida Grande',sans-serif;font-size:12px;height:100%;width:100%}#appLayout{height:100%;width:100%}.hidden{display:none!important;visibility:hidden}@font-face{font-family:'Cantora One';font-style:normal;font-weight:400;src:local('Cantora One'),local('CantoraOne-Regular'),url(CantoraOne-Regular.woff) format('woff'),url(CantoraOne-Regular.ttf) format('truetype')}h3{font-family:'Cantora One',sans-serif;font-size:20px;font-weight:normal;margin-top:.7em}header{overflow:auto;display:block;height:64px;padding:0 10px;background-color:#f2f2f2;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#fff),color-stop(100% #f2f2f2));background-image:-webkit-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:-moz-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:-ms-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:-o-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:linear-gradient(top,#fff 0,#f2f2f2 100%);border-bottom:solid #454545 1px}header h3{margin:0;line-height:58.18181818181818px;float:left}header .mainToolbar.dijitToolbar{float:left;margin-top:20px;margin-left:30px;background:0;border:0}header a{line-height:12px;font-size:12px;float:right;color:black;margin-right:30px;margin-top:26px;text-decoration:none}header a:before{content:"["}header a:after{content:"]"}header img{margin-left:10px;margin-right:15px;float:left}#detail{min-height:200px;height:40%}.detailPane .dijitTabPane{padding:1px 10px 20px}.searchbox{width:100%}.searchbox input[type=text]{width:100%}#trafficPane{border-right:solid #ccc 1px;border-bottom:solid #ccc 1px}.sidebar{padding:20px;border-left:solid #ccc 1px;background-color:#f7f7f7;min-width:200px;width:100%;height:100%;overflow-y:auto}#tutorial{position:absolute;top:94px;left:30px}.filter-hide{display:none}.filters .filter-highlight-1{background-color:rgba(255,0,0,0.2)}.search.highlight-1{box-shadow:-6px 0 0 0 #f00}.filters .filter-highlight-2{background-color:rgba(255,217,0,0.2)}.search.highlight-2{box-shadow:-6px 0 0 0 #ffd900}.filters .filter-highlight-3{background-color:rgba(0,128,0,0.2)}.search.highlight-3{box-shadow:-6px 0 0 0 #008000}.filters{margin-top:-2px;position:absolute;left:0;right:0;width:100%;height:36px;display:-webkit-box;-webkit-box-orient:horizontal;z-index:-1}.search.highlight{padding:2px;border:solid #cfcfcf 1px;border-left:none}.filters .filter-highlight{height:100%;-webkit-box-flex:1;box-flex:1}.table-fixed-header{width:100%;height:100%}.table-fixed-header table{table-layout:fixed;border-spacing:0;border-collapse:collapse;width:100%}.table-fixed-header .scroll{position:absolute;top:25px;left:0;right:0;bottom:0;overflow-y:overlay;overflow-x:hidden}.table-fixed-header .header tr{height:24px}.table-fixed-header .data td{height:36px;padding:2px 0 0;vertical-align:top;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.table-fixed-header .data td *{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.table-fixed-header .data{background-color:rgba(0,0,0,0.07);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,transparent),color-stop(50% transparent),color-stop(50% rgba(0,0,0,0.05)),color-stop(100% rgba(0,0,0,0.05)));background-image:-webkit-linear-gradient(top,transparent 0,transparent 50%,rgba(0,0,0,0.05) 50%,rgba(0,0,0,0.05) 100%);background-image:-moz-linear-gradient(top,transparent 0,transparent 50%,rgba(0,0,0,0.05) 50%,rgba(0,0,0,0.05) 100%);background-image:-ms-linear-gradient(top,transparent 0,transparent 50%,rgba(0,0,0,0.05) 50%,rgba(0,0,0,0.05) 100%);background-image:-o-linear-gradient(top,transparent 0,transparent 50%,rgba(0,0,0,0.05) 50%,rgba(0,0,0,0.05) 100%);background-image:linear-gradient(top,transparent 0,transparent 50%,rgba(0,0,0,0.05) 50%,rgba(0,0,0,0.05) 100%);background-size:1px 72px}.table-fixed-header .data tr.selected{background-color:rgba(255,244,122,0.1)}.table-fixed-header .header{background-color:#ededed;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ededed),color-stop(100% #d9d9d9));background-image:-webkit-linear-gradient(top,#ededed 0,#d9d9d9 100%);background-image:-moz-linear-gradient(top,#ededed 0,#d9d9d9 100%);background-image:-ms-linear-gradient(top,#ededed 0,#d9d9d9 100%);background-image:-o-linear-gradient(top,#ededed 0,#d9d9d9 100%);background-image:linear-gradient(top,#ededed 0,#d9d9d9 100%)}.table-fixed-header .header th{border-bottom:1px solid #a3a3a3}.table-fixed-header .header th{text-align:left;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.table-fixed-header th:last-child,.table-fixed-header td:last-child{padding-right:30px}#trafficTable{min-width:600px}#trafficTable .data thead{display:none!important;visibility:hidden}#trafficTable th.goog-tablesorter-sorted{background-color:rgba(70,185,72,0.3)}#trafficTable th.goog-tablesorter-sorted-reverse{background-color:rgba(238,68,17,0.3)}#trafficTable .size,#trafficTable .time{text-align:right}#trafficTable .subtitle{font-size:11px;color:grey}#trafficTable .time .duration{color:grey}#trafficTable .request-scheme-https .ssl{background-color:rgba(66,212,43,0.4)}#trafficTable th,#trafficTable td{cursor:pointer}col.ssl,th.ssl{width:1%}col.name,th.name{width:41.5%}col.method,col.status,th.method,th.status{width:7.5%}col.type,th.type{width:12.5%}col.size,th.size{width:10%}col.time,th.time{width:20%}#trafficTable .icon{float:left;width:32px;height:32px;margin-right:3px;background-image:url(../images/resourcePlainIcon.png)}#trafficTable .category-document .icon{background-image:url(../images/resourceDocumentIcon.png)}#trafficTable .category-image .icon{background-image:url(../images/resourceImageIcon.png)}#trafficTable .category-css .icon{background-image:url(../images/resourceCSSIcon.png)}#trafficTable .category-js .icon{background-image:url(../images/resourceJSIcon.png)}pre.preview{white-space:pre-wrap;overflow-wrap:break-word;padding:1em!important;background-color:#f0f0f0}.prettyprint ol.linenums li{list-style-type:decimal}.pre-menu-item{float:right;background-color:white;border-bottom-left-radius:5px;padding:3px 5px;margin:1px;cursor:pointer;position:relative;transition:all .1s linear}.pre-menu-item:hover{background-color:#fff47a}dl{cursor:default;font-size:11px;margin:0;width:100%}dd,dt{width:50%;margin:0;display:inline-block}dd{padding-left:8px;text-align:left}dt{font-weight:bold;text-align:right;color:#4d4d4d}.preview-image img{display:block;margin:0 auto 10px}.flowlist li{cursor:pointer}pre.raw{padding:1em;background-color:#f0f0f0;overflow-x:scroll}.button{min-width:16px;min-height:16px;display:inline-block;cursor:pointer;background-repeat:no-repeat;color:#0050c7;text-decoration:none}.button-text{padding-left:20px;line-height:16px}.button-topright{float:right;margin-left:10px}.button-popout{background-image:url(../images/window-new.png)}.button-similar{background-image:url(../images/search-similar.png)}.button-download{background-image:url(../images/document-save.png)}#detail{font-size:11px}.headers{table-layout:fixed;width:100%}.headers td,.headers td *:not(pre){white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.headers tr td:first-child{width:300px}.headers td{padding:0;vertical-align:top}.headers tr td:first-child{color:#545454;font-weight:bold;width:200px;overflow:hidden}.headers tr td:first-child.title{color:black;padding:0 0 3px}.headers .header-value{font-family:Consolas,Lucida Console,monospace}.detailPane .dijitTabListWrapper{background-color:#f2f2f2;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#fff),color-stop(100% #f2f2f2));background-image:-webkit-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:-moz-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:-ms-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:-o-linear-gradient(top,#fff 0,#f2f2f2 100%);background-image:linear-gradient(top,#fff 0,#f2f2f2 100%)}ul.checksums{list-style-type:none;padding-left:0;margin:0}ul.checksums .value{font-style:italic;font-family:Consolas,Lucida Console,monospace}.reportOutput{overflow:auto;width:100%;height:100%;padding:15px;border-right:solid #ccc 1px;border-bottom:solid #ccc 1px}#reportEditor{width:50%}.CodeMirror{background-color:white;height:auto}span.CodeMirror-matchhighlight{background:#e9e9e9}.CodeMirror-focused span.CodeMirror-matchhighlight{background:#e7e4ff!important}.reportEditorToolbar{overflow:auto}.editor-loadselect{float:right;margin-top:1px;margin-bottom:0}.editor-status{display:inline-block;color:gray;line-height:100%;font-size:.9em}
View
5 gui/css/style.less
@@ -25,6 +25,10 @@
padding: 0;
}
+.claro .dijitStackContainer-child {
+ height: 100%;
+}
+
.claro .dijitTabPaneWrapper {
overflow: auto;
}
@@ -55,7 +59,6 @@ html, body {
}
@import "helper.less";
-
//Headline
@font-face {
font-family: 'Cantora One';
View
3 gui/js/HoneyProxy/views/ReportEditor.js
@@ -35,6 +35,7 @@ define([ "lodash",
"flow": {
"request": sampleFlow.request,
"response": sampleFlow,
+ "id": sampleFlow.id,
"getSimilarFlows": sampleFlow.getSimilarFlows
},
"traffic": traffic,
@@ -47,6 +48,8 @@ define([ "lodash",
from: cm.getCursor(true),
to: cm.getCursor(false)
};
+ if(range.from.ch == range.to.ch && range.from.line == range.to.line)
+ range = {"from": {"ch": 0, "line": 0}, "to": {"ch": 0, "line": cm.lineCount()}};
cm.autoIndentRange(range.from, range.to);
};
View
2 gui/js/HoneyProxy/views/templates/DumpedFilesPane.ejs
@@ -1,4 +1,4 @@
-<div>
+<div style="height: 100%">
<!-- quick and dirty. not much effort put into this as we cannot style the directory listing very well. -->
<p style="padding: 0.5em; margin: 0; height: 50px; position: relative;">
Take care: This is a live view.
View
3 gui/js/HoneyProxy/websocket.js
@@ -34,7 +34,8 @@ define([ "./config", "dojo/json", "dojo/topic", "dojo/Deferred" ], function(
},
authenticated: new Deferred(),
init: function() {
- this.ws = new WebSocket(config.get("ws"));
+ var wsUrl = "ws://" + window.location.hostname + ":" + config.get("ws-port");
+ this.ws = new WebSocket(wsUrl);
this.ws.onopen = (function() {
this.send({
action: "auth",
View
9 honeyproxy.py
@@ -26,6 +26,8 @@
honeyproxy_dir = os.path.split(inspect.getfile( inspect.currentframe() ))[0]
+if honeyproxy_dir == "":
+ honeyproxy_dir = "."
#Verify that submodules are in place
if not os.path.isfile(os.path.join(honeyproxy_dir,"mitmproxy","mitmproxy")):
print """
@@ -102,13 +104,13 @@ def main():
#reactor.listenTCP(options.apiport, Site(websocketRes))
#Config
- wsURL = "ws://localhost:"+str(options.apiport)
+ wsPort = str(options.apiport)
httpGui = "http://honey:"+HoneyProxy.getAuthKey()+"@localhost:"+str(options.guiport)+"/"
guiURL = httpGui +"app/"
HoneyProxy.setConfig({
"proxy-addr":options.addr,
"proxy-port":options.port,
- "ws": wsURL,
+ "ws-port": wsPort,
"auth": HoneyProxy.getAuthKey(),
"dumpdir": True if options.dumpdir else False
})
@@ -138,7 +140,8 @@ def main():
print "HoneyProxy has been started!"
print "Configuration Details (normal users: ignore):"
print "GUI: "+guiURL
- print "WebSocket API: "+wsURL
+ print "Proxy Address: %s:%s" % (options.addr, options.port)
+ print "WebSocket Port: "+wsPort
print "Auth user: " + "honey"
print "Auth key: "+ HoneyProxy.getAuthKey()
View
6 libhproxy/api.py
@@ -202,7 +202,7 @@ class SearchApiResource(Resource):
(Usually this is only the case for performance reasons)
"""
isLeaf = True
-
+
def render_GET(self, request):
try:
allFlows = HoneyProxy.getProxyMaster().getFlowCollection().getFlowsSerialized()
@@ -302,4 +302,6 @@ def filterFunc(flow):
return json.dumps(filteredFlows,separators=(',',':'),encoding='latin1')
except Exception as e:
- return ServerErrorResource(e).render(request)
+ return ServerErrorResource(e).render(request)
+
+ render_POST = render_GET
View
3 scripts/report_scripts/examples/hasdep.js
@@ -1,3 +0,0 @@
-require(["ReportScripts/dep"], function(dep) {
- outNode.textContent = dep+"!";
-});
View
0 scripts/report_scripts/examples/dep.js → scripts/report_scripts/misc/dep.js
File renamed without changes.
View
8 scripts/report_scripts/misc/hasdep.js
@@ -0,0 +1,8 @@
+//All dependencies are cached by the AMD loader by default.
+//Dirty Hack to uncache
+for(k in require.modules)
+ k.indexOf("ReportScripts") === 0 && delete require.modules[k];
+
+require(["ReportScripts/misc/dep"], function(dep) {
+ outNode.textContent = dep+"!";
+});
View
10 scripts/report_scripts/misc/shortcuts.js
@@ -0,0 +1,10 @@
+/*
+
+ Ctrl-Enter: Generate Report
+ Ctrl-Space: Enable autocomplete (Special keywords: traffic, flow)
+ Ctrl-Shift-F: Autoformat selection
+ Alt-PageUp/Down: Open previous/next file.
+
+ More detailed coverage in the docs!
+
+*/
View
33 scripts/report_scripts/post_extract.js
@@ -3,27 +3,34 @@ require([
"dojo/promise/all"
], function(domConstruct, all) {
- //filter all requests for POST requests with request content
+ //filter all requests for POST requests with form data
var requests = traffic.filter(function(flow){
return flow.request.method === "POST" && flow.request.hasFormData;
});
+ if(requests.length === 0)
+ return alert("No POST requests found!");
+
console.log("Matched requests: "+requests.length+" of "+traffic.length);
- var data = {}; //Contains all POST data.
- var promises = []; //getFormData() returns a [dojo] promise.
- //this array collects all promises to trigger the result
- //output as soon as they are ready.
+ var data = {}; //Collects all POST data.
+
+ //getFormData() and getContent() are async,
+ //they both return a dojo promise.
+ //This array collects all promises to trigger the result
+ //output as soon as they are ready.
+ //Promises are covered in dojos Deferred tutorial.
+ var promises = [];
- //Iterate over all
+ //Iterate over all matched requests
_.each(requests,function(flow){
- promises.push(
- flow.request.getFormData().then(function(formData){
- if(!(flow.request.fullPath in data))
- data[flow.request.fullPath] = [];
- data[flow.request.fullPath].push(formData);
- })
- );
+ var promise =
+ flow.request.getFormData().then(function(formData){
+ if(!(flow.request.fullPath in data))
+ data[flow.request.fullPath] = [];
+ data[flow.request.fullPath].push(formData);
+ });
+ promises.push(promise);
});
all(promises).then(function(){
View
19 scripts/report_scripts/traffic_per_host.js
@@ -1,30 +1,29 @@
require([
- "dojo/dom-style",
+ "HoneyProxy/util/formatSize",
"dojox/charting/Chart",
"dojox/charting/themes/Claro",
"dojox/charting/plot2d/Pie",
"dojox/charting/action2d/Tooltip",
"dojox/charting/action2d/MoveSlice",
- "HoneyProxy/util/formatSize",
"dojox/charting/plot2d/Markers",
"dojox/charting/axis2d/Default",
-], function(domStyle, Chart, theme, Pie, Tooltip, MoveSlice,formatSize) {
-
- domStyle.set(outNode, {
- width: "100%",
- height: "100%"
- });
+], function(formatSize, Chart, theme, Pie, Tooltip, MoveSlice) {
+ // hostname -> propObj
var trafficPerHost = {};
+
+ // Iterate over all flows and sum up content lengths
traffic.each(function(flow){
var host = flow.request.host;
if(!(host in trafficPerHost))
trafficPerHost[host] = {y:0,text:"",count:0};
- trafficPerHost[host]["y"] += flow.request.contentLength + flow.response.contentLength;
+ var size = flow.request.contentLength + flow.response.contentLength;
+ trafficPerHost[host]["y"] += size;
trafficPerHost[host]["count"] += 1;
});
- var data = [];
+ //create a Dojo Charting Array from the aggregated data.
+ var data = [];
for (host in trafficPerHost){
trafficPerHost[host]["tooltip"] = trafficPerHost[host]["count"] + " requests";
trafficPerHost[host]["text"] = host + " ("+formatSize(trafficPerHost[host]["y"])+")";
View
11 web/demo/index.html
@@ -0,0 +1,11 @@
+<html>
+<head>
+<title>HoneyProxy Demo Instance</title>
+</head>
+<body>
+<script>
+window.location.href = "http://honey:proxy@honeyproxy.no-ip.org:8081/app/";
+</script>
+Click <a href="http://honey:proxy@honeyproxy.no-ip.org:8081/app/">here</a> to open the demo instance.
+</body>
+</html>
View
BIN web/img/hp_logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 93080dd

Please sign in to comment.