Closed windbug closed 11 years ago
Hi,
pushstream.js was not developed to this use case. To do that you will have to do a lot of work by yourself, but can be done.
Fist, to set different port number to each kind of location you have to set the push_stream_allowed_origins with the name of your server "example.com" as the example, to be possible the javascript has access, this is a security requirement.
Than you have to create a PushStream instance changing the urlPrefixLongpolling value to '/' and set the proper port number, and the modes to 'longpolling', as example:
new PushStream({
port: 1234,
modes: 'longpolling',
urlPrefixLongpolling: '/'
});
You will have to control when you want to use websocket, eventsource, or longpolling, because the automatically fall back done by the pushstream.js only works when all locations are on same server configuration.
There is some special reason why you whant to change some locations for some servers changing the port number?
Regards, Wandenberg
ah...thx very much for fastest reply!! 감사합니다!!!!
first of all, im so sorry. i can not write english well.
generally, use example.com/pub -> publisher example.com/lp -> longpolling example.com/ws -> websocket
by the way. i wanna use example.com:11000 -> channels-stats example.com:11001 -> publisher example.com:11002 -> subscriber example.com:11003 -> longpolling example.com:11004 -> websocket
so i change nginx.conf like this
server { listen 11001 default_server; server_name pub.example.com;
}
and then, use pushstream.js,
ws -> status offline, 404 reponse
lp -> status offline, 405 (not allowed) xmlhttprequest cannot load http://example.com:11003/example?&_=113131. Origin http://example.com is not allowed by acc-control-allow-origin
refused to get ensafe header "Etag"
how can i use it? help plz...