mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Fixup hardcoded variables in websocket example.
This commit is contained in:
parent
bb2f51ccda
commit
898d770d14
@ -8,7 +8,7 @@ http://assorted.svn.sourceforge.net/viewvc/assorted/real-time-plotter/trunk/src/
|
|||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var data = {};
|
var data = {};
|
||||||
var s = new WebSocket("ws://nebula:8000/data");
|
var s = new WebSocket("ws://%(HTTP_HOST)s/data");
|
||||||
s.onopen = function() {
|
s.onopen = function() {
|
||||||
//alert('open');
|
//alert('open');
|
||||||
s.send('hi');
|
s.send('hi');
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import collections
|
import collections
|
||||||
import errno
|
import errno
|
||||||
from gunicorn.async.base import ALREADY_HANDLED
|
from gunicorn.workers.async import ALREADY_HANDLED
|
||||||
from eventlet import pools
|
from eventlet import pools
|
||||||
import socket
|
import socket
|
||||||
import eventlet
|
import eventlet
|
||||||
@ -139,6 +139,7 @@ def app(environ, start_response):
|
|||||||
data = open(os.path.join(
|
data = open(os.path.join(
|
||||||
os.path.dirname(__file__),
|
os.path.dirname(__file__),
|
||||||
'websocket.html')).read()
|
'websocket.html')).read()
|
||||||
|
data = data % environ
|
||||||
start_response('200 OK', [('Content-Type', 'text/html'),
|
start_response('200 OK', [('Content-Type', 'text/html'),
|
||||||
('Content-Length', len(data))])
|
('Content-Length', len(data))])
|
||||||
return [data]
|
return [data]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user