How to clear all Flashphoner session.

Gain

New Member
Hello.

I want to know if I have more than 1 sessions. How can I clear all session or selected session in JavaScript ?

And one more question how can I get local IP from session if I use load balance on AWS service?

Please advice.

Gain
 
Last edited:

Max

Administrator
Staff member
Good day.
I want to know if I have more than 1 sessions. How can I clear all session or selected session in JavaScript ?
Please use REST API queries /connection/find_all to find all the sessions
Code:
POST /rest-api/connection/find_all HTTP/1.1
Host: 192.168.1.101:8081
Content-Length: 0
Content-Type: application/json
and /connection/terminate to close client session
Code:
POST /rest-api/connection/terminate HTTP/1.1
Host:192.168.1.101:8081
Content-Length: 55
Content-Type: application/json
 
{
    "sessionId":"/192.168.1.102:39564/192.168.1.101:8443"
}
And one more question how can I get local IP from session if I use load balance on AWS service?
In sessionId, first address is a client address and seconf address is a local server IP address
 

Gain

New Member
Good day.

Please use REST API queries /connection/find_all to find all the sessions
Code:
POST /rest-api/connection/find_all HTTP/1.1
Host: 192.168.1.101:8081
Content-Length: 0
Content-Type: application/json
and /connection/terminate to close client session
Code:
POST /rest-api/connection/terminate HTTP/1.1
Host:192.168.1.101:8081
Content-Length: 55
Content-Type: application/json

{
    "sessionId":"/192.168.1.102:39564/192.168.1.101:8443"
}
In sessionId, first address is a client address and seconf address is a local server IP address
Excuse me again.
I have one more question to ask.
How can I get public IP from session that created with JavaScript ?
Thank you so much.
 

Max

Administrator
Staff member
How can I get public IP from session that created with JavaScript ?
On server side, it's impossible because public IP is bound to NAT, not to the instance network interface. Public server IP is only known on client side when server domain name is resolved. So you should pass it by some way from client to your backend if you want to know it.
 

Gain

New Member
On server side, it's impossible because public IP is bound to NAT, not to the instance network interface. Public server IP is only known on client side when server domain name is resolved. So you should pass it by some way from client to your backend if you want to know it.
Thank you for your answer.

Now I have new problem to ask.
What if I live streaming and my internet connection is lost, Can I reconnect and run live streaming again from my latest stream that lost connection from internet or I have to run new live stream only ?
Ref. How to reconnect to a stream automatically this from play stream but I want to know streamer side can reconnect or not ?
Please advice.

Gain.
 

Max

Administrator
Staff member
What if I live streaming and my internet connection is lost, Can I reconnect and run live streaming again from my latest stream that lost connection from internet or I have to run new live stream only ?
Ref. How to reconnect to a stream automatically this from play stream but I want to know streamer side can reconnect or not ?
Yes, you can publish the stream with the same name again if you've lost connection and received STREAM_STATUS.FAILED or SESSION_STATUS.FAILED on client side. This can be done by the same way as player reconnection example.
 

Gain

New Member
Yes, you can publish the stream with the same name again if you've lost connection and received STREAM_STATUS.FAILED or SESSION_STATUS.FAILED on client side. This can be done by the same way as player reconnection example.
After STREAM_STATUS.PUBLISHING I tried to test STREAM_STATUS.FAILED by disconnect from internet but it don't go in .on(STREAM_STATUS.FAILED).
So, what case to do to let stream go to STREAM_STATUS.FAILED ?
Please advice.

Gain.
 

Max

Administrator
Staff member
After STREAM_STATUS.PUBLISHING I tried to test STREAM_STATUS.FAILED by disconnect from internet but it don't go in .on(STREAM_STATUS.FAILED).
If connection breaks while publishing, cilent will receive SESSION_STATUS.FAILED. See doc you mentioned.
 
Top