Simple Network Information Server (SNIS)
Matlab SNIS is a simple self hosting HTTP server.
This free implementation is useful for simple applications (It's by no means as robust as actual servers like Apache and IIS)
Features:
Http handlers for text files, images and web-services
Session state
Simple Net Script: matlab script incorporated inside html files to generate active server-side content (similar in some manners to classic ASP)
Web-services: Classes inheriting the Simple.App.Controller class registered with Simple.App.App instance are accessible via the web-service http handler (Encouraging the implementation of MVC design pattern)
Start server like that:
config = Simple.Net.HttpServerConfig([name, value, ...]);
server = Simple.Net.HttpServer(config);
% Starts listening to the configured port in a new worker
% If PCT is available, and pollable data queue exists (starting R2017 a i think)
% If PCT isn't available server.startAsync() is identical server.start().listen()
server.startAsync();
% If started asynchronously, stop server using the stop method
server.stop();
With Simple library, a sample website is available, start sample website by running snisWebSite/POC/SnisPOC.m
then access it via a browser in the url localhost:4000/
*****************************************************
Issues:
SSL/HTTPS is not available
Currently cannot be deployed using matlab compiler. That should be fixable by parsing all .sns files using the Simple.Net.SnScript.SnsHttpHandler, then including the generated .m files in the deployed app. Probably should add a conditional implementation in that http handler for when running in deployed mode.
Cite As
TADA (2024). Simple Network Information Server (SNIS) (https://www.mathworks.com/matlabcentral/fileexchange/69312-simple-network-information-server-snis), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > External Language Interfaces > Web Services with MATLAB > Call Web Services from MATLAB Using HTTP >
Tags
Acknowledgements
Inspired by: Web Server, log4m - A powerful and simple logger for matlab, UUID Generation
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
SNIS/+Simple
SNIS/+Simple/+App
SNIS/+Simple/+App/AsycTasks
SNIS/+Simple/+IO/+MXML
SNIS/+Simple/+IO/+MXML/+Tests
SNIS/+Simple/+IO/+MXML/private
SNIS/+Simple/+Net
SNIS/+Simple/+Net/+HttpHandlers
SNIS/+Simple/+Net/+Networking
SNIS/+Simple/+Net/+SnScript
SNIS/Simple3rdParty
SNIS/snisWebSite/POC
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |