Skip to content

Give Origins without a port number#633

Closed
nambad wants to merge 3 commits intosocketio:masterfrom
nambad:master
Closed

Give Origins without a port number#633
nambad wants to merge 3 commits intosocketio:masterfrom
nambad:master

Conversation

@nambad
Copy link

@nambad nambad commented Nov 10, 2011

Ok... After lot of problems and research, I realized that in the concept of origins, http://localhost is not equal to http://localhost:80

When used 'localhost' in origins, it would always give invalid origin as parts.port was always undefined. To solve this i added the below 3 lines of code

  if(!parts.port)
    {
        parts.port = 80;
    }

in the files
lib/manager.js
lib/transports/websocket/hybi-07-12.js
lib/transports/websocket/hybi-16.js
lib/transports/websocket/hybi-17.js

Make sure in configuration, origin parameter, one needs to enter "localhost:80"

Added
      if(!parts.port)
      	{
      		parts.port = 80;
      	}
      if(!parts.port)
      	{
      		parts.port = 80;
      	}
      if(!parts.port)
      	{
      		parts.port = 80;
      	}
@einaros
Copy link
Contributor

einaros commented Nov 10, 2011

Rather than this pull request, I suggest you either start or comment on an issue, with a test case that captures the unwanted behavior you're currently seeing. Based on that someone will get back to how to best fix it.

@nambad
Copy link
Author

nambad commented Nov 14, 2011

#638
Done!!

@nambad nambad closed this Nov 14, 2011
darrachequesne pushed a commit that referenced this pull request Jul 4, 2024
Fix undefined packet type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants