Client reported the following issue with curl connection

timothy.kaneshige
edited February 3 in WebSocket API

Client has configured websockets for ADS 3.8, but is unable to make a connection via curl.  Is that normal?

<dialogue snippet>

bash-5.1$ curl -v -X GET http://ADS-SERVER.com:15000/config

Note: Unnecessary use of -X or --request, GET is already inferred.

*   Trying 0.0.0.0:15000...

* Connected to ADS-SERVER.com (0.0.0.0) port 15000 (#0)

> GET /config HTTP/1.1

> Host: http://ADS-SERVER.com:15000

> User-Agent: curl/7.76.1

> Accept: */*

>

* Mark bundle as not supporting multiuse

< HTTP/1.1 400 Bad Request

< Content-Type: text/html; charset=UTF-8

< Connection: close

<

* Closing connection 0

bash-5.1$

Tagged:

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @timothy.kaneshige

    Thank you for reaching out to us.

    According to this discussion, the curl command to test webscoket connections is:

    curl --include --no-buffer --header "Connection: Upgrade" --header "Upgrade: websocket" --header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" --header "Sec-WebSocket-Version: 13" --header "Sec-WebSocket-Protocol: tr_json2" http://127.0.0.1:15000/WebSocket
    

    The output is:

    image.png