Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
june-webserver
Advanced tools
JuNe WebServer ultra-lightweight HTTP or HTTPS server to run HTML projects and for development with HMR
JuNe WebServer is a ultra-lightweight Node.js HTTP / HTTPS server to run HTML projects. And for development with Hot Module Replacement (HMR) to automatically update the page when a change occurs (using WebSockets).
Eduardo Ruiz <eruiz@dataclick.es>
The best way is to install JuNe WebServer globally to run wherever you want with npm install -g june-webserver
Then run with webserver [parameters]
...or if local installation node webserver [parameters]
/ npm start
(only to use default parameters).
You can also download compiled binaries: 🐧Linux (20 Mb), 🪟 Windows (17 Mb) or 🍎MacOS (20 Mb).
Passed as parameter (prefixed with hyphen) on command line, or an array object on class creation.
Object | Definition | Required | Default | Sample |
---|---|---|---|---|
url | URL (and port) for running | ✔ | http://localhost:8180 | - |
folder | Web project folder | ✔ | Current Work Directory | - |
cert | SSL cert file path for HTTPS | - | - | cert.pem |
key | SSL key file path for HTTPS | - | - | key.pem |
http2 | Use HTTP/2 (certs required) | - | 0 | 1 |
index | Index files to scan in folders default (sep by space) | - | index.html index.htm | - |
if404 | Returns the specified file if path does not exist | - | - | index.html |
dev | Development mode | - | false | 1 |
hmr | HMR Port in Dev mode | - | 30795 | - |
script | (only in Dev mode) Optional code (instead reload) to run when update | - | location.reload() | - |
Set -dev 1
for activate development mode.
For development mode:
<head>
tag must exist in HTML files, then JuNe WebServer adds a JavaScript code with WebSockets to check for changes and reload if necessary.script
Custom JavaScript code to run on project update or location.reload()Some projects process paths or HTML files internally in a single file, usually index.html such as JavaScript frameworks with routing system.
So if web server does not find a path, it must send the request to that file, you can do that with parameter -if404 index.html
html, htm, css, xml, txt, ics, png, gif, webp, avif, jpg, jpeg, ico, svg, mp3, mpg, mpeg, ogg, aac, opus, mp4, webm, js, mjs, json, pdf, zip, ttf, woff2.
Basic server with path and index.html
webserver -url http://localhost:8180 -folder /var/www/myproject
Load myfile.html
webserver -url http://localhost:8180 -folder /var/www/myproject -index myfile.html
Load myfile.html or myindex.html
webserver -url http://localhost:8180 -folder /var/www/myproject -index "myfile.html myindex.html"
JuNe PaulaJS project
webserver -url http://localhost:8180 -folder /var/www/myproject -if404 index.html
Development mode
webserver -url http://localhost:8180 -folder /var/www/myproject -dev 1
Development mode with JuNe PaulaJS project
webserver -url http://localhost:8180 -folder /var/www/myproject -if404 index.html -dev 1
Development mode with custom script when changes
webserver -url http://localhost:8180 -folder /var/www/myproject -dev 1 -script "alert('Changes')"
const webserver = WebServer({url: 'http://myapp.com:8180', folder: '/var/www/myproject'});
Generate a self-signed certificate, only for localhost development purposes. Avoid browser warning ´Potential Security Risk´ with a Certification Authority entity (CA).
localhost.ext
(add more IPs or domains if needed):authorityKeyIdentifier = keyid,issuer
basicConstraints = CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
IP.1 = 127.0.0.1
DNS.1 = localhost
localhost.crt
and localhost.key
openssl genrsa -out CA.key -des3 2048
openssl req -x509 -sha256 -new -nodes -days 3650 -key CA.key -out CA.pem
openssl genrsa -out localhost.crypted.key -des3 2048
openssl req -new -key localhost.crypted.key -out localhost.csr
openssl x509 -req -in localhost.csr -CA CA.pem -CAkey CA.key -CAcreateserial -days 3650 -sha256 -extfile localhost.ext -out localhost.crt
openssl rsa -in localhost.crypted.key -out localhost.key
CA.pem
Everything you need to develop your project:
FAQs
JuNe WebServer ultra-lightweight HTTP or HTTPS server to run HTML projects and for development with HMR
We found that june-webserver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.