Add a second makefile, for debug rules.

This commit is contained in:
Philippe Pittoli 2023-05-15 16:10:14 +02:00
parent d187d02de7
commit 29ece121aa

26
crystal/makefile.user Normal file
View File

@ -0,0 +1,26 @@
WS_SERVICE ?= 127.0.0.1:8080
init-websocket-tcpd:
@# '-b' binary, '-E' quit on end-of-file, 'ws-l' websocket URI to listen
@# each connection is redirected to last parameter
websocat -b -E ws-l:$(WS_SERVICE) unix:/tmp/.libipc-run/pong
init-websocket-client:
@# websocat -b -E tcp-l:127.0.0.1:9000 ws://127.0.0.1:9999
websocat -b -E ws://$(WS_SERVICE)
#
# The following rules help for debugging stuff.
# Changes can happen from time to time depending on what I'm working on.
#
TCP_SERVICE ?= 127.0.0.1:9000
init-websocket-ipc-unix:
@#websocat -b -E ws-l:$(WS_SERVICE) tcp:$(TCP_SERVICE)
@#websocat -b -E ws-l:$(WS_SERVICE) | ./bin/input2ipc | nc -U /tmp/.libipc-run/pong
websocat -b -E -s 8080 | ./bin/input2ipc | nc -U /tmp/.libipc-run/pong
# 1. read TCP messages (nc),
# 2. convert them into IPC messages (input2ipc),
# 3. send them through websocket (websocat).
init-tcpd-ipc-websocket:
nc -k -l 9000 | ./bin/input2ipc | make init-websocket-client