APE-Project / APE_Server

Ajax Push Engine : Lightweight HTTP Streaming server. Fully written in C language, it provides best performances, making it the faster Comet server to date. APE now support server-side javascript modules through spidermonkey

Home Page:www.ape-project.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scripts/framework/HTTP.js ignores port parameter and protocoll

johannesgerer opened this issue · comments

  1. the protocoll is complete ignored, so you change you example (which uses http://host into just "host")
    As only http:// seems to be possible on APE that would be enough for now.
  2. If no port is given in the url via url:port, then the port is always set to 80 even if one is given in the constructor!

My fix is to have he following priority: Constructor Agrument or, if none given: port in url, or if none given: 80

initialize: function(url, port) {
    this.url            = url;
    this.port           = port;
    this.parseURL();
},

parseURL: function() {
    var result  = this.url.match("^.*?://(.*?)(:([0-9]+))?((/.*)|)$");
    this.host   = result[1];
    this.port   = this.port || result[3] || 80;
    this.query  = result[4];
},