Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
node-http-proxy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
node-http-proxy
Commits
bdd6352d
Commit
bdd6352d
authored
Dec 23, 2011
by
indexzero
Committed by
Cédric de Saint Martin
Jan 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[refactor minor] Update vendor/websocket.js to be compatible with node@0.6.x
parent
f4653eea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
93 deletions
+91
-93
vendor/websocket.js
vendor/websocket.js
+91
-93
No files found.
vendor/websocket.js
View file @
bdd6352d
...
...
@@ -496,7 +496,7 @@ var WebSocket = function(url, proto, opts) {
if
(
u
.
protocol
===
'
ws:
'
||
u
.
protocol
===
'
wss:
'
)
{
protocol
=
u
.
protocol
===
'
ws:
'
?
http
:
https
;
port
=
u
.
protocol
===
'
ws:
'
?
80
:
443
;
agent
=
u
.
protocol
===
'
ws:
'
?
protocol
.
getAgent
(
u
.
hostname
,
u
.
port
||
port
)
:
protocol
.
get
Agent
({
agent
=
u
.
protocol
===
new
protocol
.
Agent
({
host
:
u
.
hostname
,
port
:
u
.
port
||
port
});
...
...
@@ -514,8 +514,20 @@ var WebSocket = function(url, proto, opts) {
throw
new
Error
(
'
Invalid URL scheme
\'
'
+
urlScheme
+
'
\'
specified.
'
);
}
if
(
!
agent
.
_events
||
agent
.
_events
[
'
upgrade
'
].
length
===
0
)
{
agent
.
on
(
'
upgrade
'
,
(
function
()
{
var
httpReq
=
protocol
.
request
({
host
:
u
.
hostname
,
method
:
'
GET
'
,
agent
:
agent
,
port
:
u
.
port
,
path
:
httpPath
,
headers
:
httpHeaders
});
httpReq
.
on
(
'
error
'
,
function
(
e
)
{
errorListener
(
e
);
});
httpReq
.
on
(
'
upgrade
'
,
(
function
()
{
var
data
=
undefined
;
return
function
(
res
,
s
,
head
)
{
...
...
@@ -607,20 +619,6 @@ var WebSocket = function(url, proto, opts) {
stream
.
emit
(
'
data
'
,
head
);
};
})());
}
agent
.
on
(
'
error
'
,
function
(
e
)
{
errorListener
(
e
);
});
var
httpReq
=
protocol
.
request
({
host
:
u
.
hostname
,
method
:
'
GET
'
,
agent
:
agent
,
port
:
u
.
port
,
path
:
httpPath
,
headers
:
httpHeaders
});
httpReq
.
write
(
challenge
,
'
binary
'
);
httpReq
.
end
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment