chat widget demo: robust host detection
This commit is contained in:
parent
34f8604a25
commit
4996fb712b
1 changed files with 2 additions and 3 deletions
|
@ -4,8 +4,7 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Zammad Chat</title>
|
<title>Zammad Chat</title>
|
||||||
<link rel="stylesheet" href="znuny.css">
|
<link rel="stylesheet" href="znuny.css">
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35738/livereload.js?snipver=1"></' + 'script>')</script>
|
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -134,7 +133,7 @@
|
||||||
var hostname = window.location.hostname;
|
var hostname = window.location.hostname;
|
||||||
var port = window.location.port;
|
var port = window.location.port;
|
||||||
var params = getSearchParameters();
|
var params = getSearchParameters();
|
||||||
var host = 'ws://localhost:6042'
|
var host = 'ws://'+ (location.host || 'localhost').split(':')[0] +':6042'
|
||||||
if (params['port']) {
|
if (params['port']) {
|
||||||
host = 'ws://' + hostname + ':' + params['port']
|
host = 'ws://' + hostname + ':' + params['port']
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue