Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Getting access to the request body to proxy to a development backend

Closed
#115 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, node.js
Domain
api, backend

Research direction

Start by reviewing the server's onRequest hook and the http-proxy-middleware example included in the issue. Determine how request data is currently exposed and define completion as enabling a development-backend proxy to forward form data for methods such as POST.

Written by the indexing model from the issue text.

Description

duplicate

Thanks for the great work on the 11ty ecosystem! I would like to incorporate this plugin and remove @11ty/eleventy-server-browsersync, but I have a use case similar to https://github.com/11ty/eleventy-dev-server/issues/9. Below I show my use case with the browsersync plugin and http-proxy-middleware to proxy the entire request to a development backend. I believe this library could replicate the behavior below if onRequest passed the request or request body so that I could forward the request with the form data for methods such as POST (11ty creates HTML forms that post data)

What are your thoughts on this for your library?

    const apiProxy = createProxyMiddleware({
        pathFilter: opts.intercept,
        target: opts.backend,
        changeOrigin: true,
        logger: console,
        on: {
            proxyReq: function (proxyReq, req) {
                proxyReq.setHeader("Authorization", opts.authorization || "");
                proxyReq.setHeader(
                    "Referer",
                    req.headers.referer?.replace(
                        "http://localhost:8080",
                        `http://${process.env.HOSTNAME}:8080`,
                    ) || "",
                );
            },
        },
    });

    config.setServerOptions({
        module: "@11ty/eleventy-server-browsersync",
        port: 8080,
        open: false,
        notify: false,
        ui: false,
        ghostMode: false,
        snippet: true,
        middleware: [apiProxy],
    });
Dominant language
JavaScript
Stars
109
Forks
19
Avg merge
6d 3h
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 11ty/dev-server

All issues in 11ty/dev-server

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.