我正在尝试加载测试websocket服务器.服务器接受并发送application/json,交互似乎相当不错.
服务器正确接受客户端(tsung)发送的消息.不幸的是,从客户端的角度来看,它无法读取响应,我认为可能与至少在查看tsung.dump的消息有关,我看到像NUL,SOH,SI等的ASCII字符,但我也看到了json的响应来自服务器莫名其妙.
这是我的tsung.xml文件片段:
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/Cellar/tsung/1.5.0/share/tsung/tsung-1.0.dtd">
<tsung loglevel="debug" dumptraffic="true">
<clients>
<client host="localhost" use_controller_vm="true" maxusers="1000" />
</clients>
<servers>
<server host="127.0.0.1" port="8282" type="tcp" />
</servers>
<load>
<arrivalphase phase="1" duration="120" unit="second">
<users maxnumber="1" arrivalrate="1" unit="second" />
</arrivalphase>
</load>
<sessions>
<session name="websocket" probability="100" type="ts_websocket">
<request subst="true">
<websocket type="connect" path="/fancyurl?Content-Type=application/json"></websocket>
</request>
<transaction name="getsession">
<request subst="true">
<dyn_variable name="sessionid" jsonpath="session"/>
<websocket type="message">{"type": "EventMessageCmd", "user": "lnramirez", "eventCode" : "epfl"}
</websocket>
</request>
</transaction>
<thinktime value="10"/>
<request>
<dyn_variable name="boothAck" jsonpath="commandStatus" />
<websocket type="message">
{
"user": "lramirezmonterosa",
"eventCode": …
Run Code Online (Sandbox Code Playgroud)