FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
rabbitmqexample/webSocketPython/websocket.html at master · pierakim/rabbitmqexample · GitHub
pierakim
/
rabbitmqexample
Public
forked from
Gsantomaggio/rabbitmqexample
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
rabbitmqexample
/
webSocketPython
/
websocket.html
Copy path
More file actions
More file actions
Latest commit
History
History
History
53 lines (38 loc) · 987 Bytes
Breadcrumbs
rabbitmqexample
/
webSocketPython
/
websocket.html
Copy path
File metadata and controls
53 lines (38 loc) · 987 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<
html
>
<
head
>
<
script
src
="
//code.jquery.com/jquery-1.11.0.min.js
"
>
</
script
>
<
script
>
$
(
document
)
.
ready
(
function
(
)
{
var
uri
=
window
.
location
.
host
+
window
.
location
.
pathname
+
'ws'
if
(
window
.
location
.
protocol
===
'http:'
)
{
new_uri
=
"ws:"
+
uri
;
}
else
{
new_uri
=
"wss:"
+
uri
;
}
var
ws
;
if
(
'WebSocket'
in
window
)
{
ws
=
new
WebSocket
(
new_uri
)
;
}
else
if
(
'MozWebSocket'
in
window
)
{
ws
=
new
MozWebSocket
(
new_uri
)
;
}
else
{
alert
(
"<tr><td> your browser doesn't support web socket </td></tr>"
)
;
return
;
}
ws
.
onopen
=
function
(
evt
)
{
$
(
"#idlogs"
)
.
append
(
"Connection open ...\n"
)
}
;
ws
.
onmessage
=
function
(
evt
)
{
$
(
"#idlogs"
)
.
append
(
" New message..."
+
evt
.
data
+
'\n'
)
}
;
function
closeConnect
(
)
{
ws
.
close
(
)
;
}
}
)
;
</
script
>
</
head
>
<
body
>
<
textarea
id
="
idlogs
"
cols
='
60
'
rows
='
8
'
>
...
</
textarea
>
</
body
>
<
html
>
Back
|
FazBrowse Home
|
New Git URL