正在显示
1 个修改的文件
包含
31 行增加
和
0 行删除
| @@ -320,6 +320,36 @@ class RESTSessions(object): | @@ -320,6 +320,36 @@ class RESTSessions(object): | ||
| 320 | 320 | ||
| 321 | return code | 321 | return code |
| 322 | 322 | ||
| 323 | +''' | ||
| 324 | +the server list | ||
| 325 | +''' | ||
| 326 | +class RESTServers(object): | ||
| 327 | + exposed = True | ||
| 328 | + | ||
| 329 | + def __init__(self): | ||
| 330 | + self.__server_ip = "192.168.1.142"; | ||
| 331 | + | ||
| 332 | + def GET(self): | ||
| 333 | + enable_crossdomain() | ||
| 334 | + url = "http://%s:8080/live/livestream.html"%(self.__server_ip) | ||
| 335 | + raise cherrypy.HTTPRedirect(url) | ||
| 336 | + | ||
| 337 | + def POST(self): | ||
| 338 | + enable_crossdomain() | ||
| 339 | + raise cherrypy.HTTPError(405, "Not allowed.") | ||
| 340 | + | ||
| 341 | + def DELETE(self, id): | ||
| 342 | + enable_crossdomain() | ||
| 343 | + raise cherrypy.HTTPError(405, "Not allowed.") | ||
| 344 | + | ||
| 345 | + def PUT(self, id): | ||
| 346 | + enable_crossdomain() | ||
| 347 | + raise cherrypy.HTTPError(405, "Not allowed.") | ||
| 348 | + | ||
| 349 | + | ||
| 350 | + def OPTIONS(self, id=None): | ||
| 351 | + enable_crossdomain() | ||
| 352 | + | ||
| 323 | global_chat_id = os.getpid(); | 353 | global_chat_id = os.getpid(); |
| 324 | ''' | 354 | ''' |
| 325 | the chat streams, public chat room. | 355 | the chat streams, public chat room. |
| @@ -453,6 +483,7 @@ class V1(object): | @@ -453,6 +483,7 @@ class V1(object): | ||
| 453 | self.streams = RESTStreams() | 483 | self.streams = RESTStreams() |
| 454 | self.sessions = RESTSessions() | 484 | self.sessions = RESTSessions() |
| 455 | self.chats = RESTChats() | 485 | self.chats = RESTChats() |
| 486 | + self.servers = RESTServers() | ||
| 456 | 487 | ||
| 457 | ''' | 488 | ''' |
| 458 | main code start. | 489 | main code start. |
-
请 注册 或 登录 后发表评论