npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-http-request-dynamic-tls

v1.0.4

Published

A Node-RED node for performing http(s) requests that use Request library with optimized proxy support and multipart/form-data support.

Downloads

9

Readme

node-red-contrib-http-request-dynamic-tls

This is a Node-RED node for performing HTTP(S) requests using the Request library with optimized proxy and SSL/TLS support. This node is forked from node-red-contrib-http-request to add multipart request functionality and resolve SSL/TLS issues.

Installation

To install, run:

npm install -g node-red-contrib-http-request-dynamic-tls

npm package

Features

This module builds upon the Node-RED core HTTP/HTTPS request node and the versatile Request library, which includes features for proxying, streaming, and comprehensive TLS/SSL support.

Key Enhancements:

  • Multipart Request Support: Added support for sending multipart form data in HTTP requests, a feature that the original node lacked.
  • Improved SSL/TLS Handling: Resolved issues related to SSL/TLS configuration, ensuring compatibility with secure HTTPS endpoints and proxies.
  • Optimized Proxy Support: Supports HTTP over HTTPS proxies using the CONNECT method, which is not possible with the Core Node-RED HTTP Request node.

Node Configuration and Usage

This node allows you to make HTTP(S) requests, with options that can either be configured directly in the node or passed dynamically using incoming messages (msg object).

Available Options:

  1. URL:

    • Can be configured in the node or set dynamically using msg.url.
    • Must start with http: or https:.
    • You can use mustache-style tags in the URL to insert dynamic values from the incoming message, e.g., example.com/{{{topic}}} will use the value of msg.topic.
  2. HTTP Method:

    • Configurable in the node or via msg.method.
    • Supported methods: GET, PUT, POST, PATCH, DELETE (default is GET).
  3. Headers:

    • Use msg.headers to add custom HTTP headers to the request. This should be an object containing field/value pairs.
  4. Request Body:

    • The msg.payload will be sent as the body of the request. For multipart form-data, ensure that the payload is structured correctly.
  5. SSL/TLS Options:

    • SSL/TLS certificates can be passed via msg.request.options, which includes options such as:
      • cert: The certificate for the request.
      • key: The private key for the request.
      • pfx: The pfx file for the request.
      • passphrase: The passphrase for the private key or pfx file.

Output Message:

The output message (msg) will contain:

  • payload: The body of the response.
  • statusCode: The HTTP status code of the response, or the error code if the request failed.
  • headers: An object containing the response headers.

Proxy Configuration:

To configure a proxy, set the http_proxy environment variable before starting Node-RED:

export http_proxy=http://your.proxy.server:port

Example Use Case

Need to upload a file through an HTTP POST request while using an HTTPS proxy? This module handles multipart form data and routes requests securely over a proxy, something the core Node-RED HTTP node cannot do.

Contribution

By contributing to node-red-contrib-http-request-dynamic-tls, you’re helping to build a more robust and feature-rich HTTP client for the Node-RED ecosystem. Contributions, bug reports, and suggestions are welcome!