Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
676 views
in Technique[技术] by (71.8m points)

network programming - Can a web client access local server?

As the title suggests : I want to connect a web client (developed using vue.js but that's not a must) to a local database (available in the same machine as the client that is served from a distant server). Is it possible ?

Some context :

  • I am building a website (Laravel & vue.js) that has an admin panel.
  • The admin has also a desktop application (that cannot be modified and doesn't provide any API to interact with).
  • This desktop application connects to a local database (Firebird).
  • I need my client (vue.js) application to access this database (only when it runs in the same computer. If the admin connects from a different computer, the functionality is not needed).

Question

Is there a way for my client application to :

  1. Detect if it's running in a computer where the Firebird server is running
  2. If such process is running, it tries to connect using the provided credentials (after success, I connect to it like I would to any other database)
  3. Otherwise it does nothing

Clarification

  • The web client won't necessarily be developed using vue.js
  • I considered giving the local desktop a static IP than make calls from the server directly to the computer (whenever connected) but I don't like this solution as I'll be serving the client application to the admin's desktop, I would prefer to directly connect to the database instead of (double) remotely connect to it (client app connects to backend app and backend app connects to local database that is running in the same computer as the client app).
question from:https://stackoverflow.com/questions/65886236/can-a-web-client-access-local-server

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...