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
0013ac3b
Commit
0013ac3b
authored
Aug 28, 2013
by
Wandenberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change default header template for EventSource connections
parent
a03b3f5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
19 deletions
+19
-19
ngx_http_push_stream_module_utils.h
include/ngx_http_push_stream_module_utils.h
+1
-1
event_source_spec.rb
misc/spec/subscriber/event_source_spec.rb
+18
-18
No files found.
include/ngx_http_push_stream_module_utils.h
View file @
0013ac3b
...
...
@@ -203,7 +203,7 @@ static const ngx_str_t NGX_HTTP_PUSH_STREAM_TOKEN_MESSAGE_TEXT = ngx_string("~t
static
const
ngx_str_t
NGX_HTTP_PUSH_STREAM_TOKEN_MESSAGE_TAG
=
ngx_string
(
"~tag~"
);
static
const
ngx_str_t
NGX_HTTP_PUSH_STREAM_TOKEN_MESSAGE_TIME
=
ngx_string
(
"~time~"
);
static
const
ngx_str_t
NGX_HTTP_PUSH_STREAM_EVENTSOURCE_DEFAULT_HEADER_TEMPLATE
=
ngx_string
(
""
);
static
const
ngx_str_t
NGX_HTTP_PUSH_STREAM_EVENTSOURCE_DEFAULT_HEADER_TEMPLATE
=
ngx_string
(
"
:
\r\n
"
);
static
const
ngx_str_t
NGX_HTTP_PUSH_STREAM_EVENTSOURCE_COMMENT_TEMPLATE
=
ngx_string
(
": ~text~
\r\n
"
);
static
const
ngx_str_t
NGX_HTTP_PUSH_STREAM_EVENTSOURCE_MESSAGE_PREFIX
=
ngx_string
(
"data: "
);
static
const
ngx_str_t
NGX_HTTP_PUSH_STREAM_EVENTSOURCE_ID_TEMPLATE
=
ngx_string
(
"id: ~event-id~"
);
...
...
misc/spec/subscriber/event_source_spec.rb
View file @
0013ac3b
...
...
@@ -64,7 +64,7 @@ describe "Subscriber Event Source" do
response
+=
chunk
end
sub
.
callback
do
response
.
should
eql
(
": footer line 1
\r\n
: footer line 2
\r\n
: footer line 3
\r\n
: footer line 4
\r\n\r\n
"
)
response
.
should
eql
(
":
\r\n\r\n
:
footer line 1
\r\n
: footer line 2
\r\n
: footer line 3
\r\n
: footer line 4
\r\n\r\n
"
)
EventMachine
.
stop
end
end
...
...
@@ -82,7 +82,7 @@ describe "Subscriber Event Source" do
response
+=
chunk
end
sub
.
callback
do
response
.
should
eql
(
": footer line 1
\\
nfooter line 2
\r\n\r\n
"
)
response
.
should
eql
(
":
\r\n\r\n
:
footer line 1
\\
nfooter line 2
\r\n\r\n
"
)
EventMachine
.
stop
end
end
...
...
@@ -99,8 +99,8 @@ describe "Subscriber Event Source" do
sub
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/sub/'
+
channel
.
to_s
).
get
sub
.
stream
do
|
chunk
|
response
+=
chunk
if
response
.
include?
(
"
\r\n\r\n
"
)
response
.
should
eql
(
"data:
#{
body
}
\r\n\r\n
"
)
if
response
.
include?
(
"
data:
"
)
response
.
should
eql
(
"
:
\r\n\r\n
data:
#{
body
}
\r\n\r\n
"
)
EventMachine
.
stop
end
end
...
...
@@ -120,8 +120,8 @@ describe "Subscriber Event Source" do
sub
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/sub/'
+
channel
.
to_s
).
get
sub
.
stream
do
|
chunk
|
response
+=
chunk
if
response
.
include?
(
"
\r\n\r\n
"
)
response
.
should
eql
(
"data:
#{
body
}
\r\n\r\n
"
)
if
response
.
include?
(
"
data:
"
)
response
.
should
eql
(
"
:
\r\n\r\n
data:
#{
body
}
\r\n\r\n
"
)
EventMachine
.
stop
end
end
...
...
@@ -142,8 +142,8 @@ describe "Subscriber Event Source" do
sub
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/sub/'
+
channel
.
to_s
).
get
sub
.
stream
do
|
chunk
|
response
+=
chunk
if
response
.
include?
(
"
\r\n\r\n
"
)
response
.
should
eql
(
"id:
#{
event_id
}
\r\n
data:
#{
body
}
\r\n\r\n
"
)
if
response
.
include?
(
"
data:
"
)
response
.
should
eql
(
"
:
\r\n\r\n
id:
#{
event_id
}
\r\n
data:
#{
body
}
\r\n\r\n
"
)
EventMachine
.
stop
end
end
...
...
@@ -164,8 +164,8 @@ describe "Subscriber Event Source" do
sub
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/sub/'
+
channel
.
to_s
).
get
sub
.
stream
do
|
chunk
|
response
+=
chunk
if
response
.
include?
(
"
\r\n\r\n
"
)
response
.
should
eql
(
"event:
#{
event_type
}
\r\n
data:
#{
body
}
\r\n\r\n
"
)
if
response
.
include?
(
"
data:
"
)
response
.
should
eql
(
"
:
\r\n\r\n
event:
#{
event_type
}
\r\n
data:
#{
body
}
\r\n\r\n
"
)
EventMachine
.
stop
end
end
...
...
@@ -185,8 +185,8 @@ describe "Subscriber Event Source" do
sub
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/sub/'
+
channel
.
to_s
).
get
sub
.
stream
do
|
chunk
|
response
+=
chunk
if
response
.
include?
(
"
\r\n\r\n
"
)
response
.
should
eql
(
%(data: {"id":"1", "message":"#{body}"}\r\n\r\n)
)
if
response
.
include?
(
"
data:
"
)
response
.
should
eql
(
%(
: \r\n\r\n
data: {"id":"1", "message":"#{body}"}\r\n\r\n)
)
EventMachine
.
stop
end
end
...
...
@@ -206,8 +206,8 @@ describe "Subscriber Event Source" do
sub
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/sub/'
+
channel
.
to_s
).
get
sub
.
stream
do
|
chunk
|
response
+=
chunk
if
response
.
include?
(
"
\r\n\r\n
"
)
response
.
should
eql
(
%(data: {"id":"1", "message":"#{body}"}\r\n\r\n)
)
if
response
.
include?
(
"
data:
"
)
response
.
should
eql
(
%(
: \r\n\r\n
data: {"id":"1", "message":"#{body}"}\r\n\r\n)
)
EventMachine
.
stop
end
end
...
...
@@ -228,8 +228,8 @@ describe "Subscriber Event Source" do
sub
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/sub/'
+
channel
.
to_s
).
get
sub
.
stream
do
|
chunk
|
response
+=
chunk
if
response
.
include?
(
"
\r\n\r\n
"
)
response
.
should
eql
(
%(id: #{event_id}\r\ndata: {"id":"1", "message":"#{body}"}\r\n\r\n)
)
if
response
.
include?
(
"
data:
"
)
response
.
should
eql
(
%(
: \r\n\r\n
id: #{event_id}\r\ndata: {"id":"1", "message":"#{body}"}\r\n\r\n)
)
EventMachine
.
stop
end
end
...
...
@@ -250,8 +250,8 @@ describe "Subscriber Event Source" do
sub
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/sub/'
+
channel
.
to_s
).
get
sub
.
stream
do
|
chunk
|
response
+=
chunk
if
response
.
include?
(
"
\r\n\r\n
"
)
response
.
should
eql
(
%(event: #{event_type}\r\ndata: {"id":"1", "message":"#{body}"}\r\n\r\n)
)
if
response
.
include?
(
"
data:
"
)
response
.
should
eql
(
%(
: \r\n\r\n
event: #{event_type}\r\ndata: {"id":"1", "message":"#{body}"}\r\n\r\n)
)
EventMachine
.
stop
end
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