Skip to content


Subversion checkout URL

You can clone with
Download ZIP


ReferenceError: url is not defined #101

budnix opened this Issue · 1 comment

2 participants


verify_origin in /src/ throw exception "ReferenceError: url is not defined" missing "url = require('url');"

javascript version (sockjs-node)

  exports.verify_origin = function(origin, list_of_origins) {
    var origins, parts;
    if (list_of_origins.indexOf('*:*') !== -1) return true;
    if (!origin) return false;
    try {
      parts = url.parse(origin);
// port should be defined as default if the parser returns undefined
      parts.port = parts.port || 80;

      origins = [ + ':' + parts.port, + ':*', '*:' + parts.port];
console.log(list_of_origins, origins);
      if (array_intersection(origins, list_of_origins).length > 0) return true;
    } catch (x) {

    return false;
@majek majek closed this in d16856d

Good news - you're right - the url was undeclared. Thanks for spotting that.

Bad news: support for origins was never done fully - and it's impossible to get it working for all the transports. I removed the origins-related code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.