Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meta-elphel393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
meta-elphel393
Commits
e68bc710
Commit
e68bc710
authored
Jul 23, 2021
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
files for testing lighttpd mod_wstunnel
parent
ba354660
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
0 deletions
+56
-0
echo.pl
recipes-extended/lighttpd/files/echo.pl
+6
-0
lighttpd-proxy.conf
recipes-extended/lighttpd/files/lighttpd-proxy.conf
+9
-0
lighttpd-wstunnel.conf
recipes-extended/lighttpd/files/lighttpd-wstunnel.conf
+23
-0
wstunnel_count.html
recipes-extended/lighttpd/files/wstunnel_count.html
+18
-0
No files found.
recipes-extended/lighttpd/files/echo.pl
0 → 100755
View file @
e68bc710
#!/usr/bin/perl -Tw
$SIG
{
PIPE
}
=
'IGNORE'
;
for
(
my
$FH
;
accept
(
$FH
,
STDIN
);
close
$FH
)
{
select
(
$FH
);
$|
=
1
;
# $FH->autoflush;
print
$FH
$_
while
(
<
$FH
>
);
}
recipes-extended/lighttpd/files/lighttpd-proxy.conf
0 → 100644
View file @
e68bc710
server
.
document
-
root
=
"/www/pages"
# not used in this example
#server.bind = "127.0.0.1"
server
.
port
=
8080
server
.
modules
+= (
"mod_proxy"
)
proxy
.
server
= (
"/"
=> ((
"host"
=>
"127.0.0.1"
,
"port"
=>
"8081"
)))
proxy
.
header
= (
"upgrade"
=>
"enable"
)
recipes-extended/lighttpd/files/lighttpd-wstunnel.conf
0 → 100644
View file @
e68bc710
server
.
document
-
root
=
"/tmp"
# not used in this example
#server.bind = "127.0.0.1"
#server.port = 8081
server
.
port
=
80
mimetype
.
assign
= (
".txt"
=>
"text/plain"
,
".html"
=>
"text/html"
)
server
.
modules
+= (
"mod_wstunnel"
)
wstunnel
.
server
= (
"/ws/"
=> (
(
"socket"
=>
"/tmp/wstunnel.socket"
,
"bin-path"
=>
"/www/pages/echo.pl"
,
"max-procs"
=>
1
)
),
"/ws-nobin/"
=> (
(
"socket"
=>
"/tmp/wstunnel-nobin.socket"
,
# "bin-path" => "/www/pages/echo.pl",
"max-procs"
=>
1
)
)
)
recipes-extended/lighttpd/files/wstunnel_count.html
0 → 100644
View file @
e68bc710
<!DOCTYPE html>
<!-- modified from example in https://github.com/joewalnes/websocketd README.md -->
<pre
id=
"log"
></pre>
<script>
// helper function: log message to screen
var
logelt
=
document
.
getElementById
(
'log'
);
function
log
(
msg
)
{
logelt
.
textContent
+=
msg
+
'
\
n'
;
}
// helper function: send websocket msg with count (1 .. 5)
var
host
=
location
.
hostname
;
log
(
'SERVER: '
+
host
);
var
ll
=
0
;
function
send_msg
()
{
if
(
++
ll
<=
5
)
{
log
(
'SEND: '
+
ll
);
ws
.
send
(
ll
+
'
\
n'
);
}
}
// setup websocket with callbacks
var
ws
=
new
WebSocket
(
'ws://'
+
host
+
':80/ws/'
);
ws
.
onopen
=
function
()
{
log
(
'CONNECT
\
n'
);
send_msg
();
};
ws
.
onclose
=
function
()
{
log
(
'DISCONNECT'
);
};
ws
.
onmessage
=
function
(
event
)
{
log
(
'RECV: '
+
event
.
data
);
send_msg
();
};
</script>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment