How to serve a frontend in Vue.js/Vue-cli on the local network and use it for workstations that have no internet connection?

Asked

Viewed 196 times

0

I need to develop a web application with the following scenario:

  • Server: hosts the application, has internet connection to communicate with Apis;
  • Stations: restricted machines, no internet connection, users will interact with the application hosted on the server

My current experiment consists of a frontend made with Vue.js/Vue-cli, served by a proxy (express.js) in Node.js.

I have a desktop (I will call the server) and a note (I will call the workstation) connected to the same network by a wi-fi router and I have already managed to make the "workstation" access the application hosted on the "server", using for example, the address http://10.0.10.133:3000, 10.0.10.133 (server ip) + 3000 (port used by proxy).

My question is: is the workstation really operating the internet-free frontend? How can I make sure of that? What can I do to simulate restricting access to the internet at the workstation?

1 answer

0


Inside Chrome, use the Ctrl+Shift+J shortcut. When opening the developer console, select the network tab and check in the request lists that all of them are done to your local server. For more information about the request, you can click on it.

If a request is being made to another host and its status is 200, your workstation is accessing external resources from your server over the internet.

Exemplo da lista de requisições

  • Willian, obg for help. I checked the requests, they are all done to "server" ip and work. Does this prove that the application accessed by the station is not using the internet? I ask this because I can not restrict the internet in the station, I came to create an exit rule in the windows firewall, blocking Chrome connections, but when testing the application in the station, all requests failed.

  • I believe so! If all the requests made go to the "server", the station is not connecting to the internet to access the application. You just need to ensure that the connection between the station and the server is made through the local network. To improve the security of this system, it would be better to use a hub or switch to connect the stations on the server, without needing an external network connection

  • 1

    @Diogomarins you can block the external connection by IP Rage on your Router, or simply put the Router to point solely and exclusively to your Server, ie, connect all Clients to a Router that connects n server and has no Network output port, this will prevent internet access and allow only the server to be accessed and the API will work because the front requests will be made to the server and the server will route out and return, the client will not be able to use this "ruse" to access sites outside the API

  • flourigh, obg for help. I do not have access to the router system because it is provided by my internet operator, as if it were "armored", I can only do very few things for a mobile app... Of any.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.