File tree 3 files changed +28
-2
lines changed
3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ debug() {
18
18
19
19
if [[ " ${DEV:- true} " == true ]]; then
20
20
USE_HMR=" $( which inotifywait) "
21
+
22
+ # disable HMR when using netcat
23
+ if [[ " $TCP_PROVIDER " == " nc" ]]; then
24
+ USE_HMR=" "
25
+ fi
21
26
fi
22
27
23
28
header () {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ will check:
11
11
- ` HIDE_LOGO` - if this is set, the "powered by bash" logo will be hidden
12
12
- ` NO_STYLES` - if this is set, no CSS will be linked in the `<head>`
13
13
- ` ENABLE_SESSIONS` - if this is 'true', bash stack will manage sessions (using a `_session` cookie).
14
+ - `TCP_PROVIDER` (default : tcpserver) - you can optionally use `nc` instead.
14
15
15
16
# # Tailwind
16
17
Original file line number Diff line number Diff line change @@ -23,8 +23,28 @@ mkdir -p data
23
23
mkdir -p uploads
24
24
25
25
PORT=${PORT:- 3000}
26
- echo -n " Listening on port "
27
- tcpserver -1 -o -l 0 -H -R -c 1000 0 $PORT ./core.sh
26
+
27
+ TCP_PROVIDER=${TCP_PROVIDER:- tcpserver}
28
+
29
+ case " $TCP_PROVIDER " in
30
+ tcpserver)
31
+ echo -n " Listening on port "
32
+ tcpserver -1 -o -l 0 -H -R -c 1000 0 $PORT ./core.sh
33
+ ;;
34
+ nc)
35
+ [[ ! -p nc_tunnel ]] && mkfifo nc_tunnel
36
+ [[ " ${DEV:- true} " == true ]] && \
37
+ echo " WARNING: performance while using netcat will be significantly degraded!"
38
+ echo " Listening on port $PORT "
39
+ while true ; do
40
+ < nc_tunnel nc -l $PORT | ./core.sh > nc_tunnel
41
+ done
42
+ ;;
43
+ * )
44
+ echo " ERROR: unsupported TCP_PROVIDER"
45
+ exit 1
46
+ ;;
47
+ esac
28
48
29
49
if [[ ! -z " $PID " ]]; then
30
50
kill " $PID "
You can’t perform that action at this time.
0 commit comments