Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-04-14 17:31:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b1877db405af740a5ce1019f80e6832097edc354
b1877db4
1 parent
b86c83b0
fix typo of full.conf. fix api server bug
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
10 行增加
和
7 行删除
trunk/conf/full.conf
trunk/research/api-server/server.py
trunk/conf/full.conf
查看文件 @
b1877db
...
...
@@ -28,7 +28,7 @@ ff_log_dir ./objs;
srs_log_tank
file
;
# the log level, for all log tanks.
# can be: verbose, info, trace, warn, error
# def
ua
lt: trace
# def
au
lt: trace
srs_log_level
trace
;
# when srs_log_tank is file, specifies the log file.
# default: ./objs/srs.log
...
...
trunk/research/api-server/server.py
查看文件 @
b1877db
...
...
@@ -44,6 +44,10 @@ def trace(msg):
print
"[
%
s][trace]
%
s"
%
(
date
,
msg
)
# enable crossdomain access for js-client
# define the following method:
# def OPTIONS(self, *args, **kwargs)
# enable_crossdomain()
# invoke this method to enable js to request crossdomain.
def
enable_crossdomain
():
cherrypy
.
response
.
headers
[
"Access-Control-Allow-Origin"
]
=
"*"
cherrypy
.
response
.
headers
[
"Access-Control-Allow-Methods"
]
=
"GET, POST, HEAD, PUT, DELETE"
...
...
@@ -121,7 +125,7 @@ class RESTClients(object):
return
str
(
code
)
def
OPTIONS
(
self
):
def
OPTIONS
(
self
,
*
args
,
**
kwargs
):
enable_crossdomain
()
def
__on_connect
(
self
,
req
):
...
...
@@ -208,7 +212,7 @@ class RESTStreams(object):
return
str
(
code
)
def
OPTIONS
(
self
):
def
OPTIONS
(
self
,
*
args
,
**
kwargs
):
enable_crossdomain
()
def
__on_publish
(
self
,
req
):
...
...
@@ -295,7 +299,7 @@ class RESTSessions(object):
return
str
(
code
)
def
OPTIONS
(
self
):
def
OPTIONS
(
self
,
*
args
,
**
kwargs
):
enable_crossdomain
()
def
__on_play
(
self
,
req
):
...
...
@@ -377,7 +381,7 @@ class RESTServers(object):
enable_crossdomain
()
raise
cherrypy
.
HTTPError
(
405
,
"Not allowed."
)
def
OPTIONS
(
self
,
id
=
None
):
def
OPTIONS
(
self
,
*
args
,
**
kwargs
):
enable_crossdomain
()
global_chat_id
=
os
.
getpid
();
...
...
@@ -502,8 +506,7 @@ class RESTChats(object):
raise
cherrypy
.
HTTPError
(
405
,
"Not allowed."
)
def
OPTIONS
(
self
,
id
=
None
):
def
OPTIONS
(
self
,
*
args
,
**
kwargs
):
enable_crossdomain
()
# HTTP RESTful path.
...
...
请
注册
或
登录
后发表评论