Public port setting affects URI scheme

This commit is contained in:
Nikolaos Anastopoulos
2012-03-23 20:42:12 +02:00
parent 3d26782125
commit e4d4edba75
3 changed files with 6 additions and 3 deletions

View File

@@ -32,7 +32,7 @@ beef:
port: "3000"
# if running behind a nat set the public ip address here
#public: ""
#public_port: ""
#public_port: ""
dns: "localhost"
panel_path: "/ui/panel"
hook_file: "/hook.js"

View File

@@ -124,7 +124,7 @@ beef.net = {
push: function(stream) {
//need to implement wait feature here eventually
for (var i = 0; i < stream.pc; i++) {
this.request('http', 'GET', this.host, this.port, this.handler, null, stream.get_packet_data(), 10, 'text', null);
this.request(this.port == '443' ? 'https' : 'http', 'GET', this.host, this.port, this.handler, null, stream.get_packet_data(), 10, 'text', null);
}
},

View File

@@ -51,7 +51,10 @@ module Modules
# @note if http_port <> public_port in config ini, use the public_port
if hook_session_config['beef_port'] != hook_session_config['beef_public_port']
hook_session_config['beef_port'] = hook_session_config['beef_public_port']
hook_session_config['beef_url'].sub!(/#{hook_session_config['beef_port']}/, hook_session_config['beef_public_port'])
hook_session_config['beef_url'].sub!(/#{hook_session_config['beef_port']}/, hook_session_config['beef_public_port'])
if hook_session_config['beef_public_port'] == '443'
hook_session_config['beef_url'].sub!(/http:/, 'https:')
end
end
# @note populate place holders in the beefjs string and set the response body