# Deploy webchat ngrok socket io

**URL:** <https://forum.rasa.com/t/deploy-webchat-ngrok-socket-io/14127>\
**Category:** Rasa Open Source\
**Created:** [August 9, 2019, 8:36am UTC](https://forum.rasa.com/t/deploy-webchat-ngrok-socket-io/14127 "2019-08-09T08:36:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SallemiDorsaf](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@SallemiDorsaf](https://forum.rasa.com/u/SallemiDorsaf)\
**Post date:** [August 9, 2019, 8:36am UTC](https://forum.rasa.com/t/deploy-webchat-ngrok-socket-io/14127/1 "2019-08-09T08:36:28Z")

</div>

hi i try to use rasa webchat but i can’t make it work

> Title
> WebChat.default.init({ selector: "#webchat", initPayload: "/get\_started", interval: 1000, // 1000 ms between each message customData: { "sender": "django" }, // arbitrary custom data. Stay minimal as this will be added to the socket socketUrl: "http://6892a642.ngrok.io:5005", title: "Connect", subtitle: "The bot which connects people", profileAvatar: "https://rasa.com/assets/img/demo/rasa\_avatar.png", showCloseButton: true, fullScreenMode: false, hideWhenNotConnected: false,
> 
> ```
> })
> </script>
> 
> ```

connector.py: from rasa.core.agent import Agent from rasa.core.interpreter import RasaNLUInterpreter from rasa.core.channels.socketio import SocketIOInput from rasa.utils.endpoints import EndpointConfig from rasa.core.interpreter import NaturalLanguageInterpreter

```
# load your trained agent
action_endpoint=EndpointConfig(url="http://6892a642.ngrok.io:5055/webhook")
interpreter = NaturalLanguageInterpreter.create('./models/20190809-043054/nlu')
agent = Agent.load('./models/20190809-043054/core', interpreter=interpreter)

input_channel = SocketIOInput(
# event name for messages sent from the user
user_message_evt="user_uttered",
# event name for messages sent from the bot
bot_message_evt="bot_uttered",
# socket.io namespace to use for the messages
namespace=None
)

# set serve_forever=False if you want to keep the server running
s = agent.handle_channels([input_channel], http_port=5005,route='/webhooks/',cors="*")

```

socketio: user\_message\_evt: user\_uttered bot\_message\_evt: bot\_uttered session\_persistence: true

rasa: url: “[http://localhost:5002/api](http://localhost:5002/api)”

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/a/adf561f1132b524b25f92fd7ae2900f440cdd0ba.png)

---

<div class="post-metadata">

**Author:** ![SallemiDorsaf](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@SallemiDorsaf](https://forum.rasa.com/u/SallemiDorsaf)\
**Post date:** [August 9, 2019, 1:19pm UTC](https://forum.rasa.com/t/deploy-webchat-ngrok-socket-io/14127/2 "2019-08-09T13:19:26Z")

</div>

when i run rasa run --endpoints endpoints.yml i get engineio.server - [http://localhost:63342](http://localhost:63342) is not an accepted origin.

---

<div class="post-metadata">

**Author:** ![SallemiDorsaf](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@SallemiDorsaf](https://forum.rasa.com/u/SallemiDorsaf)\
**Post date:** [August 14, 2019, 10:20am UTC](https://forum.rasa.com/t/deploy-webchat-ngrok-socket-io/14127/3 "2019-08-14T10:20:11Z")

</div>

i didn’t fix it yet ☹ can someone help me pleaase

---

<div class="post-metadata">

**Author:** ![Juste](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/juste/32/15_2.png) [@Juste](https://forum.rasa.com/u/Juste)\
**Post date:** [August 14, 2019, 12:04pm UTC](https://forum.rasa.com/t/deploy-webchat-ngrok-socket-io/14127/4 "2019-08-14T12:04:33Z")

</div>

Hi @SallemiDorsaf. Hmm, I think you problem is related to the endpoint URLs. I can see that WebChat gets an ngrok socketUrl with the port 5005, but you agent uses /webhooks route. Do you have ngrok instance running on 5005 port? Also, is there a specific reason you use ngrok for custom action server (`action_endpoint`) config?

Can you test the connection when you remove the route configuration from the agent.handle\_channels configuration and start the ngrok instance on the same port (5005)?

---

<div class="post-metadata">

**Author:** ![SallemiDorsaf](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@SallemiDorsaf](https://forum.rasa.com/u/SallemiDorsaf)\
**Post date:** [August 14, 2019, 12:24pm UTC](https://forum.rasa.com/t/deploy-webchat-ngrok-socket-io/14127/5 "2019-08-14T12:24:44Z")

</div>

hi @Juste i removed the route configuration from the agent.handle\_channels and start the ngrok instance on 5005 i still get same problem there is no specific reason to use ngrok but i didn’t found step by step documentation to deploy my bot can you help me ? thank you

---

<div class="post-metadata">

**Author:** ![Juste](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/juste/32/15_2.png) [@Juste](https://forum.rasa.com/u/Juste)\
**Post date:** [August 15, 2019, 8:15am UTC](https://forum.rasa.com/t/deploy-webchat-ngrok-socket-io/14127/6 "2019-08-15T08:15:48Z")

</div>

I just found my old writeup on how to do it. Can you try following it and checking if that works? [Connect rasa to a web site with the recommeded plataform](http://forum.rasa.com/t/connect-rasa-to-a-web-site-with-the-recommeded-plataform/4019/3). It uses a slightly older versions of the Rasa NLU and Core, but the main process should be the same.

---

<div class="post-metadata">

**Author:** ![Juste](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/juste/32/15_2.png) [@Juste](https://forum.rasa.com/u/Juste)\
**Post date:** [August 15, 2019, 8:17am UTC](https://forum.rasa.com/t/deploy-webchat-ngrok-socket-io/14127/7 "2019-08-15T08:17:43Z")

</div>

Also, for the sake of simplicity, I would suggest first testing it with a local custom action server: `EndpointConfig(url='http://localhost:5055/webhook')`

---

<div class="post-metadata">

**Author:** ![SallemiDorsaf](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@SallemiDorsaf](https://forum.rasa.com/u/SallemiDorsaf)\
**Post date:** [August 15, 2019, 9:26am UTC](https://forum.rasa.com/t/deploy-webchat-ngrok-socket-io/14127/8 "2019-08-15T09:26:44Z")

</div>

i get this error

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/9/9df4f76996adfcd6d1f09c12a5dda45ae467782d.png)
