<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Websocket support]]></title><description><![CDATA[<p dir="auto">Hi there!</p>
<p dir="auto">I am interested in using the websocket connection that Mango provides. I am also interested in developing apps with other frameworks other than AngularJS that may be served separately from Mango.</p>
<p dir="auto">I know of the REST API, but hooking into the websocket provides the responsiveness that I am looking for.</p>
<p dir="auto">I am wondering if it is possible for you guys to add the ability to enable cross-origin support for the websocket?</p>
<p dir="auto">Regards,<br />
Leandro</p>
]]></description><link>https://forum.mango-os.com/topic/3413/websocket-support</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 13:45:52 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/3413.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 13 Apr 2018 12:16:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Websocket support on Thu, 25 Oct 2018 16:31:07 GMT]]></title><description><![CDATA[<p dir="auto">It looks like <a class="plugin-mentions-user plugin-mentions-a" href="/user/leandro" aria-label="Profile: leandro">@<bdi>leandro</bdi></a> is opening the websocket connection from a browser, in which case only session authentication is an option. You can't set the <code>Authorization</code> header using the browser WebSocket API.</p>
]]></description><link>https://forum.mango-os.com/post/20342</link><guid isPermaLink="true">https://forum.mango-os.com/post/20342</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Thu, 25 Oct 2018 16:31:07 GMT</pubDate></item><item><title><![CDATA[Reply to Websocket support on Thu, 25 Oct 2018 16:23:11 GMT]]></title><description><![CDATA[<p dir="auto">You can watch the network tab for an example of acquiring a session cookie and xsrf token by using the /ui/login page and the network tools, or find the best example on the forum for the framework you're using.</p>
<p dir="auto">Basic authentication and Token authentication are also options!</p>
]]></description><link>https://forum.mango-os.com/post/20341</link><guid isPermaLink="true">https://forum.mango-os.com/post/20341</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 25 Oct 2018 16:23:11 GMT</pubDate></item><item><title><![CDATA[Reply to Websocket support on Thu, 25 Oct 2018 15:51:01 GMT]]></title><description><![CDATA[<p dir="auto">Actually, never mind. I am able to connect to the websocket on a console on a logged in tab.</p>
<p dir="auto">Now I need to figure out how to log in and use that in my connection.</p>
]]></description><link>https://forum.mango-os.com/post/20339</link><guid isPermaLink="true">https://forum.mango-os.com/post/20339</guid><dc:creator><![CDATA[leandro]]></dc:creator><pubDate>Thu, 25 Oct 2018 15:51:01 GMT</pubDate></item><item><title><![CDATA[Reply to Websocket support on Thu, 25 Oct 2018 15:34:34 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Thanks for the input and sorry for the long delay. I am finally able to tackle this again.</p>
<p dir="auto">I have tried as you suggested and I too get the 403 and 405 errors. Can you provide an example of how to do this while logged?</p>
<p dir="auto">I think that I should be able to run :</p>
<pre><code>new WebSocket('ws://localhost:8080/rest/v1/websocket/point-values')
</code></pre>
<p dir="auto">or (not sure of the difference):</p>
<pre><code>new WebSocket('ws://localhost:8080/rest/v2/point-values')
</code></pre>
<p dir="auto">within the console of a correctly logged in session and connect to the ws server.</p>
]]></description><link>https://forum.mango-os.com/post/20338</link><guid isPermaLink="true">https://forum.mango-os.com/post/20338</guid><dc:creator><![CDATA[leandro]]></dc:creator><pubDate>Thu, 25 Oct 2018 15:34:34 GMT</pubDate></item><item><title><![CDATA[Reply to Websocket support on Thu, 17 May 2018 22:44:53 GMT]]></title><description><![CDATA[<p dir="auto">Hi Leandro,</p>
<p dir="auto">Sorry to be delayed in getting back to you. Have you attempted changing the env.properties associated with CORS? I believe the relevant section of the code for that part of the configuration happens here: <a href="https://github.com/infiniteautomation/ma-core-public/blob/main/Core/src/com/serotonin/m2m2/web/mvc/spring/MangoWebSocketConfiguration.java#L77" rel="nofollow ugc">https://github.com/infiniteautomation/ma-core-public/blob/main/Core/src/com/serotonin/m2m2/web/mvc/spring/MangoWebSocketConfiguration.java#L77</a></p>
<p dir="auto">The console on the left is with the env.properties</p>
<pre><code>rest.cors.enabled=false
rest.cors.allowedOrigins=
</code></pre>
<p dir="auto">while the console on the right has the properties</p>
<pre><code>rest.cors.enabled=true
rest.cors.allowedOrigins=localhost:8080,127.0.0.1:8080
</code></pre>
<p dir="auto"><img src="https://camo.nodebb.org/2e48bf13663bf652314e07628c0b9902d14a2306?url=https%3A%2F%2Fi.imgur.com%2FtsuEz1e.png" alt="0_1526596998184_corsConsoles.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Note that in the right console I am still getting a 403 error for my request to 127.0.0.1:8080, probably because I didn't login on that hostname and don't have a valid session in an accessible cookie to send as a header in the websocket request. The reason I am getting 405s is that I didn't try to register for a real websocket, I was merely testing if the origin would be permitted, and it was. I can provide a more complete example if requested where the logging in gets done and a session cookie is available to the browser's JavaScript.</p>
<p dir="auto">Hope that's helpful!</p>
]]></description><link>https://forum.mango-os.com/post/18485</link><guid isPermaLink="true">https://forum.mango-os.com/post/18485</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 17 May 2018 22:44:53 GMT</pubDate></item><item><title><![CDATA[Reply to Websocket support on Fri, 20 Apr 2018 19:35:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/leandro" aria-label="Profile: leandro">@<bdi>leandro</bdi></a> said in <a href="/post/18017">Websocket support</a>:</p>
<blockquote>
<p dir="auto">I am wondering if it is possible for you guys to add the ability to enable cross-origin support for the websocket?</p>
</blockquote>
<p dir="auto">Yes definitely, I wasn't aware that it wasn't working. I'll make an issue around this and look into it.</p>
]]></description><link>https://forum.mango-os.com/post/18105</link><guid isPermaLink="true">https://forum.mango-os.com/post/18105</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Fri, 20 Apr 2018 19:35:28 GMT</pubDate></item></channel></rss>