Skip to content

devsnek/caddy-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

caddy-js

This plugin allows you to run JavaScript within your proxy logic.

Example

A server which responds "website with js"

# Caddyfile
:80 {
  route / {
    js "./proxy.js"
  }
  respond "website"
}
// proxy.js
async function handler(request) {
  const res = await fetch(request);
  const body = await res.text();
  return new Response(`${body} with js`, res);
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published