Chat bot is having issue connecting to web circuit

Hi Team, need help in knowing as to why chat bot is not able to connect to websocket using the trace below

======================

2023-02-07 16:19:42,358 - INFO - stdout - write - Connecting to WebSocket wss://api.collab.refinitiv.com/services/nt/api/messenger/v1/stream ...

2023-02-07 16:19:42,389 - DEBUG - websocket - debug - Connecting proxy...

2023-02-07 16:19:42,389 - DEBUG - websocket - dump - --- request header ---

2023-02-07 16:19:42,389 - DEBUG - websocket - dump - CONNECT http://api.collab.refinitiv.com:443 HTTP/1.1

Host: http://api.collab.refinitiv.com:443

Proxy-Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

2023-02-07 16:19:42,389 - DEBUG - websocket - dump - -----------------------

2023-02-07 16:19:42,389 - DEBUG - websocket - trace - --- response header ---

2023-02-07 16:19:42,452 - DEBUG - websocket - trace - HTTP/1.0 200 Connection established

2023-02-07 16:19:42,452 - DEBUG - websocket - trace - -----------------------

2023-02-07 16:19:42,577 - DEBUG - websocket - dump - --- request header ---

2023-02-07 16:19:42,577 - DEBUG - websocket - dump - GET /services/nt/api/messenger/v1/stream HTTP/1.1

Upgrade: websocket

Host: api.collab.refinitiv.com

Origin: https://api.collab.refinitiv.com

Sec-WebSocket-Key: F9NtUb/arQhPOE7/hYhpoA==

Sec-WebSocket-Version: 13

Connection: Upgrade

Sec-WebSocket-Protocol: messenger-json

2023-02-07 16:19:42,577 - DEBUG - websocket - dump - -----------------------

2023-02-07 16:19:42,577 - DEBUG - websocket - trace - --- response header ---

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - HTTP/1.1 101 Switching Protocols

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - Upgrade: websocket

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - Connection: Upgrade

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - Sec-WebSocket-Accept: 1DFNbPgIcIdeycRnV72ly4iU008=

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - Sec-WebSocket-Protocol: messenger-json

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - X-Nitro-Hostname: dtcp-clantsv12

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - X-Nitro-Version: 2.23.6

2023-02-07 16:19:42,624 - DEBUG - websocket - trace - -----------------------



Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @arbie.tapel

    Thank you for contacting us. Could you please let me know if the chatbot cannot connect to the Chatbot WebSocket server every time or only sometimes?

    • Please share the snippet code and full log messages.
    • Does the client has any Firewall or proxy policy on their site?

    I did a quick test with the Python example and it can connect to the Chatbot WebSocket successfully. The trace messages are as follows:

    Connecting to WebSocket wss://api.collab.refinitiv.com/services/nt/api/messenger/v1/stream ...
    --- request header ---
    2023-02-08 11:45:14: DEBUG:websocket :--- request header ---
    GET /services/nt/api/messenger/v1/stream HTTP/1.1
    Upgrade: websocket
    Host: api.collab.refinitiv.com
    Origin: https://api.collab.refinitiv.com
    Sec-WebSocket-Key: RvXt22cFF6FtAKHozlKd8g==
    Sec-WebSocket-Version: 13
    Connection: Upgrade
    Sec-WebSocket-Protocol: messenger-json


    2023-02-08 11:45:14: DEBUG:websocket :GET /services/nt/api/messenger/v1/stream HTTP/1.1
    Upgrade: websocket
    Host: api.collab.refinitiv.com
    Origin: https://api.collab.refinitiv.com
    Sec-WebSocket-Key: RvXt22cFF6FtAKHozlKd8g==
    Sec-WebSocket-Version: 13
    Connection: Upgrade
    Sec-WebSocket-Protocol: messenger-json
    -----------------------
    2023-02-08 11:45:14: DEBUG:websocket :-----------------------
    --- response header ---
    2023-02-08 11:45:14: DEBUG:websocket :--- response header ---
    HTTP/1.1 101 Switching Protocols
    2023-02-08 11:45:14: DEBUG:websocket :HTTP/1.1 101 Switching Protocols
    Upgrade: websocket
    2023-02-08 11:45:14: DEBUG:websocket :Upgrade: websocket
    Connection: Upgrade
    2023-02-08 11:45:14: DEBUG:websocket :Connection: Upgrade
    Sec-WebSocket-Accept: IFhQ9c43ld0S0Pdo00Fy1BvbE5U=
    2023-02-08 11:45:14: DEBUG:websocket :Sec-WebSocket-Accept: IFhQ9c43ld0S0Pdo00Fy1BvbE5U=
    Sec-WebSocket-Protocol: messenger-json
    2023-02-08 11:45:14: DEBUG:websocket :Sec-WebSocket-Protocol: messenger-json
    X-Nitro-Hostname: dtcp-clantsv10
    2023-02-08 11:45:14: DEBUG:websocket :X-Nitro-Hostname: dtcp-clantsv10
    X-Nitro-Version: 2.23.6
    2023-02-08 11:45:14: DEBUG:websocket :X-Nitro-Version: 2.23.6
    -----------------------
    2023-02-08 11:45:14: DEBUG:websocket :-----------------------
    2023-02-08 11:45:14: INFO:root :Receive: onopen event. WebSocket Connection is established

    Example code:

    web_socket_app = websocket.WebSocketApp(
            ws_url,
            on_message=on_message,
            on_error=on_error,
            on_close=on_close,
            on_open=on_open,
            subprotocols=['messenger-json'])
    ...
    def on_open(_):  # Called when handshake is complete and websocket is open, send login
        # send RDP Login authen


Answers

  • I want to tell my story, which has become an important lesson for me and my family. When my parents noticed that I started chatting with the chatbot all day long, they got worried and noticed changes in my behavior and mood. This led to the appearance of mental disorders in me. I ended up needing DBT (Dialectical Behavior Therapy) and turned to https://us.calmerry.com/blog/therapy/dialectical-behavior-therapy/ for help. Thanks to this therapy and the support of professionals, I was able to learn how to better manage my emotions and develop healthy coping strategies. I am proud of my progress and grateful to my parents and the service for their support and professional help.