mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix typo of full.conf. fix api server bug
This commit is contained in:
parent
b86c83b0e0
commit
b1877db405
2 changed files with 10 additions and 7 deletions
|
@ -28,7 +28,7 @@ ff_log_dir ./objs;
|
||||||
srs_log_tank file;
|
srs_log_tank file;
|
||||||
# the log level, for all log tanks.
|
# the log level, for all log tanks.
|
||||||
# can be: verbose, info, trace, warn, error
|
# can be: verbose, info, trace, warn, error
|
||||||
# defualt: trace
|
# default: trace
|
||||||
srs_log_level trace;
|
srs_log_level trace;
|
||||||
# when srs_log_tank is file, specifies the log file.
|
# when srs_log_tank is file, specifies the log file.
|
||||||
# default: ./objs/srs.log
|
# default: ./objs/srs.log
|
||||||
|
|
|
@ -44,6 +44,10 @@ def trace(msg):
|
||||||
print "[%s][trace] %s"%(date, msg)
|
print "[%s][trace] %s"%(date, msg)
|
||||||
|
|
||||||
# enable crossdomain access for js-client
|
# 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():
|
def enable_crossdomain():
|
||||||
cherrypy.response.headers["Access-Control-Allow-Origin"] = "*"
|
cherrypy.response.headers["Access-Control-Allow-Origin"] = "*"
|
||||||
cherrypy.response.headers["Access-Control-Allow-Methods"] = "GET, POST, HEAD, PUT, DELETE"
|
cherrypy.response.headers["Access-Control-Allow-Methods"] = "GET, POST, HEAD, PUT, DELETE"
|
||||||
|
@ -121,7 +125,7 @@ class RESTClients(object):
|
||||||
|
|
||||||
return str(code)
|
return str(code)
|
||||||
|
|
||||||
def OPTIONS(self):
|
def OPTIONS(self, *args, **kwargs):
|
||||||
enable_crossdomain()
|
enable_crossdomain()
|
||||||
|
|
||||||
def __on_connect(self, req):
|
def __on_connect(self, req):
|
||||||
|
@ -208,7 +212,7 @@ class RESTStreams(object):
|
||||||
|
|
||||||
return str(code)
|
return str(code)
|
||||||
|
|
||||||
def OPTIONS(self):
|
def OPTIONS(self, *args, **kwargs):
|
||||||
enable_crossdomain()
|
enable_crossdomain()
|
||||||
|
|
||||||
def __on_publish(self, req):
|
def __on_publish(self, req):
|
||||||
|
@ -295,7 +299,7 @@ class RESTSessions(object):
|
||||||
|
|
||||||
return str(code)
|
return str(code)
|
||||||
|
|
||||||
def OPTIONS(self):
|
def OPTIONS(self, *args, **kwargs):
|
||||||
enable_crossdomain()
|
enable_crossdomain()
|
||||||
|
|
||||||
def __on_play(self, req):
|
def __on_play(self, req):
|
||||||
|
@ -377,7 +381,7 @@ class RESTServers(object):
|
||||||
enable_crossdomain()
|
enable_crossdomain()
|
||||||
raise cherrypy.HTTPError(405, "Not allowed.")
|
raise cherrypy.HTTPError(405, "Not allowed.")
|
||||||
|
|
||||||
def OPTIONS(self, id=None):
|
def OPTIONS(self, *args, **kwargs):
|
||||||
enable_crossdomain()
|
enable_crossdomain()
|
||||||
|
|
||||||
global_chat_id = os.getpid();
|
global_chat_id = os.getpid();
|
||||||
|
@ -502,8 +506,7 @@ class RESTChats(object):
|
||||||
|
|
||||||
raise cherrypy.HTTPError(405, "Not allowed.")
|
raise cherrypy.HTTPError(405, "Not allowed.")
|
||||||
|
|
||||||
|
def OPTIONS(self, *args, **kwargs):
|
||||||
def OPTIONS(self, id=None):
|
|
||||||
enable_crossdomain()
|
enable_crossdomain()
|
||||||
|
|
||||||
# HTTP RESTful path.
|
# HTTP RESTful path.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue