mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
update api server, add servers
This commit is contained in:
parent
8295169e0e
commit
c3c2767363
1 changed files with 31 additions and 0 deletions
|
@ -320,6 +320,36 @@ class RESTSessions(object):
|
||||||
|
|
||||||
return code
|
return code
|
||||||
|
|
||||||
|
'''
|
||||||
|
the server list
|
||||||
|
'''
|
||||||
|
class RESTServers(object):
|
||||||
|
exposed = True
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.__server_ip = "192.168.1.142";
|
||||||
|
|
||||||
|
def GET(self):
|
||||||
|
enable_crossdomain()
|
||||||
|
url = "http://%s:8080/live/livestream.html"%(self.__server_ip)
|
||||||
|
raise cherrypy.HTTPRedirect(url)
|
||||||
|
|
||||||
|
def POST(self):
|
||||||
|
enable_crossdomain()
|
||||||
|
raise cherrypy.HTTPError(405, "Not allowed.")
|
||||||
|
|
||||||
|
def DELETE(self, id):
|
||||||
|
enable_crossdomain()
|
||||||
|
raise cherrypy.HTTPError(405, "Not allowed.")
|
||||||
|
|
||||||
|
def PUT(self, id):
|
||||||
|
enable_crossdomain()
|
||||||
|
raise cherrypy.HTTPError(405, "Not allowed.")
|
||||||
|
|
||||||
|
|
||||||
|
def OPTIONS(self, id=None):
|
||||||
|
enable_crossdomain()
|
||||||
|
|
||||||
global_chat_id = os.getpid();
|
global_chat_id = os.getpid();
|
||||||
'''
|
'''
|
||||||
the chat streams, public chat room.
|
the chat streams, public chat room.
|
||||||
|
@ -453,6 +483,7 @@ class V1(object):
|
||||||
self.streams = RESTStreams()
|
self.streams = RESTStreams()
|
||||||
self.sessions = RESTSessions()
|
self.sessions = RESTSessions()
|
||||||
self.chats = RESTChats()
|
self.chats = RESTChats()
|
||||||
|
self.servers = RESTServers()
|
||||||
|
|
||||||
'''
|
'''
|
||||||
main code start.
|
main code start.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue