tsung
tsung copied to clipboard
websocket configuration conflicts
trafficstars
I'm trying to test a websocket endpoint, but I had to disable Origin check on the websocket server because:
- When
websocket_pathis set:
<options>
<option name="websocket_path" value="/cable"/>
</options>
websocket origin option (<websocket type="connect" origin="http://localhost:3000"></websocket>) is ignored, making the server fail the Origin check
- When I remove
websocket_pathoption/chatpath is set by tsung, even if I specify a different path in the request:
<request subst="true">
<websocket type="connect" origin="http://localhost:3000" path="/cable"></websocket>
</request>
Details
-
tsung version: 1.7.0
-
tsung.xml:
-
1st version (fails because of Origin check):
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd" [] >
<tsung loglevel="info">
<clients>
<client host="localhost" use_controller_vm="true"/>
</clients>
<servers>
<server host="localhost" port="3000" type="websocket"></server>
</servers>
<load>
<arrivalphase phase="1" duration="100" unit="second">
<users maxnumber="1" arrivalrate="1" unit="second" />
</arrivalphase>
</load>
<options>
<option name="websocket_path" value="/cable"/>
</options>
<sessions>
<session probability="100" name="websocket-example" type="ts_websocket">
<request subst="true">
<websocket type="connect" origin="http://localhost:3000"></websocket>
</request>
<request>
<websocket type="close"></websocket>
</request>
</session>
</sessions>
</tsung>
- 2nd version (fails because of path set to
/chat):
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd" [] >
<tsung loglevel="info">
<clients>
<client host="localhost" use_controller_vm="true"/>
</clients>
<servers>
<server host="localhost" port="3000" type="websocket"></server>
</servers>
<load>
<arrivalphase phase="1" duration="100" unit="second">
<users maxnumber="1" arrivalrate="1" unit="second" />
</arrivalphase>
</load>
<sessions>
<session probability="100" name="websocket-example" type="ts_websocket">
<request subst="true">
<websocket type="connect" origin="http://localhost:3000" path="/cable"></websocket>
</request>
<request>
<websocket type="close"></websocket>
</request>
</session>
</sessions>
</tsung>