- Use MATLAB Web App Server: If you're using MATLAB Web App Server, you can access request headers to retrieve the IP address. However, direct access to server variables like in .NET is not available in MATLAB. You might need to handle this on the server side using a proxy or middleware to pass the IP address to your MATLAB code.
- Capture IP Address via Middleware: Implement a middleware layer in your web server (like Apache or Nginx) to capture the IP address and pass it as a parameter to your MATLAB function. This approach requires configuring your server to include the IP address in requests to MATLAB.
- Use MATLAB Production Server: If using MATLAB Production Server, you can configure request handling to include custom headers with the IP address. This involves setting up your server to capture and forward the IP address to your MATLAB function.
HOW TO RETRIEVE A VISITOR'S IP ADDRESS
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
How can I retrieve the IP address of visitors to my web app using MATLAB ?
for example in .NET, we can use:
public string IpAddress()
{ string strIpAddress; strIpAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (strIpAddress == null)
{ strIpAddress = Request.ServerVariables["REMOTE_ADDR"]; }
return strIpAddress; }
thank you
0 Commenti
Risposte (1)
Hari
il 13 Nov 2024 alle 3:08
Hi mohammad,
I understand that you want to retrieve the IP address of visitors to your web application using MATLAB, similar to how it's done in .NET.
I assume you have a MATLAB-based web application, possibly using MATLAB Web App Server or MATLAB Production Server.
Here are some of the way you can try out.
Refer to the documentation of MATLAB Web App Server for deployment details: https://www.mathworks.com/help/webappserver/
Refer to the documentation of MATLAB Production Server for request handling: https://www.mathworks.com/help/mps/
Hope this helps!
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!