-echo -n launch afb...
-case "$1" in
- gdb) gdb $AFB -ex "run $ARGS";;
- valgrind) valgrind --leak-check=full $AFB $ARGS 2>&1 | tee $OUT;;
- strace) strace -tt -f -o $OUT.strace $AFB $ARGS 2>&1 | tee $OUT;;
- *) $AFB $ARGS 2>&1 | tee $OUT;;
+case $tool in
+ gdb) cmd="$(type -p gdb) -ex run --args";;
+ valgrind) cmd="$(type -p valgrind) --leak-check=full";;
+ strace) cmd="$(type -p strace) -tt -f -o $OUT.strace";;
+ *) cmd=;;
+esac
+
+if $ws; then
+ CMD="$AFB -q --no-ldpaths --binding=$HELLO --session-max=100 --ws-server=unix:@afw/hello --no-httpd --exec $cmd $AFB --session-max=100 --port=$PORT --no-ldpaths --roothttp=$TEST --token=$TOKEN --ws-client=unix:@afw/hello "
+else
+ CMD="$cmd $AFB -q --session-max=100 --port=$PORT --workdir=$ROOT --roothttp=$TEST --token=$TOKEN --no-ldpaths --binding=$HELLO"
+fi
+
+
+echo "launch: $CMD $@"
+case $tool in
+ gdb) $CMD "$@";;
+ *) $CMD "$@" 2>&1 | tee $OUT;