Revision history [back]

click to hide/show revision 1
initial version

Hello. It's impossible to use curl utility when Zaqar is configured to use websocket driver.

Basically you are trying to use HTTP RESTful API ("wsgi" transport driver in "zaqar.conf"), while your Zaqar is configured to provide Websocket API ("websocket" transport driver in "zaqar.conf") with default port 9000.

NOTE: DevStack during "stack.sh" starts two instances of Zaqar: first one configured to use Websocket driver and listen on port 9000 (strictly using config "/etc/zaqar/zaqar.conf"), second one configured to use WSGI driver and listen on port 8888 (using config "/etc/zaqar/zaqar.conf" with transport driver option changed to "wsgi". If "~/.zaqar/zaqar.conf" configuration file exists, it overrides "/etc/zaqar/zaqar.conf"). But seems like you run Zaqar manually. In this case it's the same: if "~/.zaqar/zaqar.conf" configuration file exists, it overrides "/etc/zaqar/zaqar.conf"

If you run Zaqar using "stack.sh" script, there must be Zaqar instance running on port 8888, so just send your curl requests to port 8888.

If you run Zaqar manually:

If you want to use curl utility, the only solution is to configure Zaqar to use wsgi back end:

1) Find [drivers] section in your "zaqar.conf" and ensure that transport option is set to wsgi:

transport = wsgi

2) If you haven't changed port option in [drivers:transport:wsgi] section in "zaqar.conf", Zaqar will listen on default wsgi port 8888.

Or If you still want to use Zaqar Websocket API:

You can keep the current Zaqar configuration, but have to write client application that can connect to Zaqar through Websocket protocol or use the existing one. I don't know any existing ones, except websocket client example written in javascript in Zaqar repository: "examples/websocket.html". You can edit it and open it in your web-browser.

Please note that if you want to use Zaqar with keystone authentication in this websocket client example, you have to either:

a) Bypass CORS checks in your web browser. Follow Bypass CORS Errors When Testing APIs Locally instruction.

or

b) Turn on CORS in keystone. Follow Enabling CORS in OpenStack APIs instruction. Also add open_expose_headers=X-Subject-Token to [filter:cors] section, so websocket client will be able to get authentication token from HTTP header "X-Subject-Token".

PS: I'm a newbie developer in Zaqar. Zaqar still has not it's Configuration Reference hosted anywhere, but it will be fixed very soon and you'll be able to read conveniently about Zaqar configuration options. ;)