Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nginx-push-stream-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
nginx-push-stream-module
Commits
d512497f
Commit
d512497f
authored
Dec 29, 2014
by
arusakov
Committed by
Wandenberg
Dec 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pushstream.js Utils.isCrossDomainUrl bugfix for IE
Signed-off-by:
Wandenberg
<
wandenberg@gmail.com
>
parent
1228624a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
pushstream.js
misc/js/pushstream.js
+14
-6
No files found.
misc/js/pushstream.js
View file @
d512497f
...
...
@@ -422,9 +422,10 @@ Authors: Wandenberg Peixoto <wandenberg@gmail.com>, Rogério Carvalho Schneider
var
getSubscriberUrl
=
function
(
pushstream
,
prefix
,
extraParams
,
withBacktrack
)
{
var
websocket
=
pushstream
.
wrapper
.
type
===
WebSocketWrapper
.
TYPE
;
var
useSSL
=
pushstream
.
useSSL
;
var
port
=
normalizePort
(
useSSL
,
pushstream
.
port
);
var
url
=
(
websocket
)
?
((
useSSL
)
?
"
wss://
"
:
"
ws://
"
)
:
((
useSSL
)
?
"
https://
"
:
"
http://
"
);
url
+=
pushstream
.
host
;
url
+=
(
(
!
useSSL
&&
pushstream
.
port
===
80
)
||
(
useSSL
&&
pushstream
.
port
===
443
))
?
""
:
(
"
:
"
+
pushstream
.
port
);
url
+=
(
port
?
(
"
:
"
+
port
)
:
""
);
url
+=
prefix
;
var
channels
=
getChannelsPath
(
pushstream
.
channels
,
withBacktrack
);
...
...
@@ -439,10 +440,10 @@ Authors: Wandenberg Peixoto <wandenberg@gmail.com>, Rogério Carvalho Schneider
};
var
getPublisherUrl
=
function
(
pushstream
)
{
var
channel
=
""
;
var
port
=
normalizePort
(
pushstream
.
useSSL
,
pushstream
.
port
)
;
var
url
=
(
pushstream
.
useSSL
)
?
"
https://
"
:
"
http://
"
;
url
+=
pushstream
.
host
;
url
+=
(
(
pushstream
.
port
!==
80
)
&&
(
pushstream
.
port
!==
443
))
?
(
"
:
"
+
pushstream
.
port
)
:
""
;
url
+=
(
port
?
(
"
:
"
+
port
)
:
""
)
;
url
+=
pushstream
.
urlPrefixPublisher
;
url
+=
"
?id=
"
+
getChannelsPath
(
pushstream
.
channels
,
false
);
...
...
@@ -463,6 +464,11 @@ Authors: Wandenberg Peixoto <wandenberg@gmail.com>, Rogério Carvalho Schneider
return
domainParts
.
slice
(
-
1
*
keepNumber
).
join
(
'
.
'
);
};
var
normalizePort
=
function
(
useSSL
,
port
)
{
port
=
Number
(
port
||
(
useSSL
?
443
:
80
));
return
((
!
useSSL
&&
port
===
80
)
||
(
useSSL
&&
port
===
443
))
?
""
:
port
;
};
Utils
.
isCrossDomainUrl
=
function
(
url
)
{
if
(
!
url
)
{
return
false
;
...
...
@@ -471,9 +477,12 @@ Authors: Wandenberg Peixoto <wandenberg@gmail.com>, Rogério Carvalho Schneider
var
parser
=
document
.
createElement
(
'
a
'
);
parser
.
href
=
url
;
var
srcPort
=
normalizePort
(
window
.
location
.
protocol
===
"
https:
"
,
window
.
location
.
port
);
var
dstPort
=
normalizePort
(
parser
.
protocol
===
"
https:
"
,
parser
.
port
);
return
(
window
.
location
.
protocol
!==
parser
.
protocol
)
||
(
window
.
location
.
hostname
!==
parser
.
hostname
)
||
(
window
.
location
.
port
!==
parser
.
p
ort
);
(
srcPort
!==
dstP
ort
);
};
var
linker
=
function
(
method
,
instance
)
{
...
...
@@ -748,8 +757,7 @@ Authors: Wandenberg Peixoto <wandenberg@gmail.com>, Rogério Carvalho Schneider
this
.
urlWithBacktrack
=
getSubscriberUrl
(
this
.
pushstream
,
this
.
pushstream
.
urlPrefixLongpolling
,
{},
true
);
this
.
urlWithoutBacktrack
=
getSubscriberUrl
(
this
.
pushstream
,
this
.
pushstream
.
urlPrefixLongpolling
,
{},
false
);
this
.
xhrSettings
.
url
=
this
.
urlWithBacktrack
;
this
.
xhrSettings
.
crossDomain
=
Utils
.
isCrossDomainUrl
(
this
.
urlWithBacktrack
);
this
.
useJSONP
=
this
.
xhrSettings
.
crossDomain
||
this
.
pushstream
.
useJSONP
;
this
.
useJSONP
=
this
.
pushstream
.
_crossDomain
||
this
.
pushstream
.
useJSONP
;
this
.
xhrSettings
.
scriptId
=
"
PushStreamManager_
"
+
this
.
pushstream
.
id
;
if
(
this
.
useJSONP
)
{
this
.
pushstream
.
messagesControlByArgument
=
true
;
...
...
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