V
V
Vlad Volodko2020-11-12 05:20:05
Node.js
Vlad Volodko, 2020-11-12 05:20:05

How to connect node to laravel for chat?

Hello. There is an application written in vuejs which lies on a separate server from the backend which is written in laravel. Now the task is to implement a chat in the application. The server part of the chat is written in nodejs The

question is that I can’t figure out how to connect the broadcast of Lara, which lies on server_1, and the application itself, which lies on server_2. How to broadcast correctly and how to listen to it later?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-11-12
@firedragon

somewhere in the template

<!-- vladimir map widget -->
<div class='central-meta item'>
<link href="/test/css/map.css" rel="stylesheet" />
<link href="/test/css/app.css" rel="preload" as="style" />
<link href="/test/css/chunk-vendors.css" rel="preload" as="style" />
<link href="/test/js/app.js" rel="preload" as="script" />
<link href="/test/js/chunk-vendors.js" rel="preload" as="script" />
<link href="/test/css/chunk-vendors.css" rel="stylesheet" />
<link href="/test/css/app.css" rel="stylesheet" />
<div id='app'></div>

<script src="/test/js/raphael.min.js"></script>
<script src="/test/js/settings.js"></script>
<script src="/test/js/paths.js"></script>
<script src="/test/js/map.js"></script>
<script src="/test/js/chunk-vendors.js"></script>
<script src="/test/js/app.js"></script>
</div>
<!-- end vladimir map widget -->

In your nginx config
# api для карты
        location /api/mapinfo {
            proxy_pass         http://localhost:5010/api/mapinfo;
            proxy_http_version 1.1;
            proxy_set_header   Upgrade $http_upgrade;
            proxy_set_header   Connection keep-alive;
            proxy_set_header   Host $host;
            proxy_cache_bypass $http_upgrade;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header   X-Forwarded-Proto $scheme;
        }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question