@@ -195,8 +195,8 @@ If needed you can change this behavior using some additional directives and chan
...
@@ -195,8 +195,8 @@ If needed you can change this behavior using some additional directives and chan
port:window.location.port,
port:window.location.port,
modes:"longpolling",
modes:"longpolling",
longPollingByHeaders:false,
longPollingByHeaders:false,
longPollingTagArgument:'tag',//this is the default value, you have to change it to be the same value used on push_stream_last_received_message_tag directive
tagArgument:'tag',//this is the default value, you have to change it to be the same value used on push_stream_last_received_message_tag directive
longPollingTimeArgument:'time'//this is the default value, you have to change it to be the same value used on push_stream_last_received_message_time directive
timeArgument:'time'//this is the default value, you have to change it to be the same value used on push_stream_last_received_message_time directive
});
});
pushstream.onmessage=messageReceived;
pushstream.onmessage=messageReceived;
pushstream.addChannel('ch1');
pushstream.addChannel('ch1');
...
@@ -274,10 +274,10 @@ _The configuration in the example is the same used on long polling, just forcing
...
@@ -274,10 +274,10 @@ _The configuration in the example is the same used on long polling, just forcing
port:window.location.port,
port:window.location.port,
modes:"longpolling",
modes:"longpolling",
longPollingByHeaders:false,
longPollingByHeaders:false,
longPollingTagArgument:'tag',//this is the default value, you have to change it to be the same value used on push_stream_last_received_message_tag directive
tagArgument:'tag',//this is the default value, you have to change it to be the same value used on push_stream_last_received_message_tag directive
longPollingTimeArgument:'time',//this is the default value, you have to change it to be the same value used on push_stream_last_received_message_time directive
timeArgument:'time',//this is the default value, you have to change it to be the same value used on push_stream_last_received_message_time directive
longPollingUseJSONP:true,//this is used only to force jsonp usage on example, it is automatic true when the domains are different
useJSONP:true,//this is used only to force jsonp usage on example, it is automatic true when the domains are different
longPollingTimeout:30000//this is the default value, you have to change it to be the same value used on push_stream_longpolling_connection_ttl directive in miliseconds
timeout:30000//this is the default value, you have to change it to be the same value used on push_stream_longpolling_connection_ttl directive in miliseconds
| useSSL | false | boolean | if should use or not SSL on the connection |
| useSSL | false | boolean | if should use or not SSL on the connection |
| host | current host name | string | the host name to connect and get messages |
| host | current host name | string | the host name to connect and get messages |
| port | 80/443 (if using SSL) | number | the port number to connect and get messages |
| port | 80/443 (if using SSL) | number | the port number to connect and get messages |
| timeout | 15000 | number | the amount of time to consider that a connection has some problem (in milliseconds) |
| timeout | 30000 | number | the amount of time to consider that a connection has some problem (in milliseconds) |
| pingtimeout | 30000 | number | the amount of time to consider that a connection does not receive a ping message (in milliseconds) |
| pingtimeout | 30000 | number | the amount of time to consider that a connection does not receive a ping message (in milliseconds) |
| reconnecttimeout | 3000 | number | the amount of time to do a new connection after a timeout happens (in milliseconds) |
| reconnectOnTimeoutInterval | 3000 | number | the amount of time to do a new connection after a timeout happens (in milliseconds) |
| checkChannelAvailabilityInterval | 60000 | number | the amount of time to do a new connection after receives a 403, indicating that a channel is unavailable (in milliseconds) |
| reconnectOnChannelUnavailableInterval | 60000 | number | the amount of time to do a new connection after receives a 403, indicating that a channel is unavailable (in milliseconds) |
| secondsAgo | - | number | get messages published at less than this time, on the first connection using long polling |
| secondsAgo | - | number | get messages published at less than this time, on the first connection using long polling |
| longPollingByHeaders | true | boolean | when to use time and tag values by headers instead of arguments on long polling connections |
| longPollingByHeaders | true | boolean | when to use time and tag values by headers instead of arguments on long polling connections |
| longPollingTagArgument | 'tag' | string | argument name to send tag value on long polling connections, specially used on JSONP mode |
| tagArgument | 'tag' | string | argument name to send tag value on long polling connections, specially used on JSONP mode |
| longPollingTimeArgument | 'time' | string | argument name to send time value on long polling connections, specially used on JSONP mode |
| timeArgument | 'time' | string | argument name to send time value on long polling connections, specially used on JSONP mode |
| longPollingUseJSONP | false | boolean | when to use JSONP mode on long polling connections, mandatorily true when current domain or port is different from the target server (cross domain restrictions) |
| useJSONP | false | boolean | when to use JSONP mode on long polling connections, mandatorily true when current domain or port is different from the target server (cross domain restrictions) |
| longPollingTimeout | 30000 | number | the amount of time to consider that a long polling connection does not receive any data |
| longPollingInterval | 100 | number | the amount of time to do a new connection after receive a message or a timeout happens on long polling connections |
| urlPrefixPublisher | '/pub' | string | the location prefix used to post messages |
| urlPrefixPublisher | '/pub' | string | the location prefix used to post messages |
| urlPrefixStream | '/sub' | string | the location prefix used to do Stream mode connections |
| urlPrefixStream | '/sub' | string | the location prefix used to do Stream mode connections |
| urlPrefixEventsource | '/ev' | string | the location prefix used to do EventSource mode connections |
| urlPrefixEventsource | '/ev' | string | the location prefix used to do EventSource mode connections |
...
@@ -55,7 +53,7 @@ Example:
...
@@ -55,7 +53,7 @@ Example:
| urlPrefixWebsocket | '/ws' | string | the location prefix used to do WebSocket mode connections |
| urlPrefixWebsocket | '/ws' | string | the location prefix used to do WebSocket mode connections |
| jsonIdKey | 'id' | string | the key name to extract message id from received message |
| jsonIdKey | 'id' | string | the key name to extract message id from received message |
| jsonChannelKey | 'channel' | string | the key name to extract channel id from received message |
| jsonChannelKey | 'channel' | string | the key name to extract channel id from received message |
| jsonDataKey | 'text' | string | the key name to extract message data from received message |
| jsonTextKey | 'text' | string | the key name to extract message text from received message |
| jsonTagKey | 'tag' | string | the key name to extract message tag from received message |
| jsonTagKey | 'tag' | string | the key name to extract message tag from received message |
| jsonTimeKey | 'time' | string | the key name to extract message time from received message |
| jsonTimeKey | 'time' | string | the key name to extract message time from received message |
| jsonEventIdKey | 'eventid' | string | the key name to extract message event id from received message |
| jsonEventIdKey | 'eventid' | string | the key name to extract message event id from received message |
...
@@ -83,4 +81,4 @@ Example:
...
@@ -83,4 +81,4 @@ Example:
| onerror | implement this function to be notified when an error happens, the argument received is an object with a key named 'type' indicating if was a 'load' or a 'timeout' error |
| onerror | implement this function to be notified when an error happens, the argument received is an object with a key named 'type' indicating if was a 'load' or a 'timeout' error |
| onstatuschange | implement this function to receive the new connection status as argument, which can be PushStream.CLOSED, PushStream.CONNECTING or PushStream.OPEN |
| onstatuschange | implement this function to receive the new connection status as argument, which can be PushStream.CLOSED, PushStream.CONNECTING or PushStream.OPEN |
| onchanneldeleted | implement this function to be notified when a channel was deleted on the server. The channel id will be the given argument|
| onchanneldeleted | implement this function to be notified when a channel was deleted on the server. The channel id will be the given argument|
| onmessage | implement this function to receive the messages from server, the arguments are, in order: data, id, channel, eventid, isLastMessageFromBatch. The isLastMessageFromBatch argument indicate when is, or not, the last message received on a batch when using long polling connections |
| onmessage | implement this function to receive the messages from server, the arguments are, in order: text, id, channel, eventid, isLastMessageFromBatch. The isLastMessageFromBatch argument indicate when is, or not, the last message received on a batch when using long polling connections |