Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mqttjs/MQTT.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.10.4
Choose a base ref
...
head repository: mqttjs/MQTT.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.11.0
Choose a head ref
  • 7 commits
  • 12 files changed
  • 5 contributors

Commits on Feb 26, 2025

  1. chore(deps-dev): bump esbuild from 0.24.2 to 0.25.0 (#1967)

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Feb 26, 2025
    Copy the full SHA
    6ee354b View commit details

Commits on Mar 4, 2025

  1. feat: add intrinsic support for SOCKS proxies (#1966)

    * Socks proxy support for TCP and TLS connections.
    
    * Documentation.
    
    * Ignore socks for UNIX domain sockets.
    
    * Avoid bundling dead code.
    
    * Naming.
    
    * Update readme.
    
    * Update lock file.
    
    * Simplify.
    
    Co-authored-by: Daniel Lando <daniel.sorridi@gmail.com>
    
    * Trade duplexify against home-grown wrapper.
    
    * Paranoia, linter.
    
    * Minor cleanup.
    
    * Tests.
    
    * Use a fixed port for the tests.
    
    * It seems TCP RST causes the remote to close without EOF on Linux -> test is useless on Linux.
    
    * Switch back to dynamic port allocation.
    
    ---------
    
    Co-authored-by: Daniel Lando <daniel.sorridi@gmail.com>
    DirtyHairy and robertsLando authored Mar 4, 2025
    Copy the full SHA
    ee0fcce View commit details
  2. chore(deps): update mqtt-packet and koa to latest versions

    robertsLando committed Mar 4, 2025
    Copy the full SHA
    d68febd View commit details

Commits on Apr 8, 2025

  1. fix: correct return type of validateTopis to include null (#1979)

    Mallikarjun-0 authored Apr 8, 2025
    Copy the full SHA
    935784a View commit details

Commits on Apr 9, 2025

  1. chore(deps): bump koa from 2.16.0 to 2.16.1 (#1980)

    Bumps [koa](https://github.com/koajs/koa) from 2.16.0 to 2.16.1.
    - [Release notes](https://github.com/koajs/koa/releases)
    - [Changelog](https://github.com/koajs/koa/blob/master/History.md)
    - [Commits](koajs/koa@2.16.0...v2.16.1)
    
    ---
    updated-dependencies:
    - dependency-name: koa
      dependency-version: 2.16.1
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 9, 2025
    Copy the full SHA
    4bd5d2b View commit details

Commits on Apr 10, 2025

  1. chore(deps): bump koa from 2.16.0 to 2.16.1 (#1980)

    Bumps [koa](https://github.com/koajs/koa) from 2.16.0 to 2.16.1.
    - [Release notes](https://github.com/koajs/koa/releases)
    - [Changelog](https://github.com/koajs/koa/blob/master/History.md)
    - [Commits](koajs/koa@2.16.0...v2.16.1)
    
    ---
    updated-dependencies:
    - dependency-name: koa
      dependency-version: 2.16.1
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 10, 2025
    Copy the full SHA
    2759864 View commit details
  2. chore(release): 5.11.0

    robertsLando authored and robertsLando committed Apr 10, 2025
    Copy the full SHA
    c8b5475 View commit details
Showing with 1,056 additions and 252 deletions.
  1. +12 −0 CHANGELOG.md
  2. +4 −0 README.md
  3. +20 −0 esbuild.js
  4. +240 −246 package-lock.json
  5. +4 −3 package.json
  6. +4 −0 src/lib/client.ts
  7. +9 −0 src/lib/connect/index.ts
  8. +236 −0 src/lib/connect/socks.ts
  9. +7 −0 src/lib/connect/tcp.ts
  10. +19 −2 src/lib/connect/tls.ts
  11. +1 −1 src/lib/validations.ts
  12. +500 −0 test/node/socks.ts
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@


# [5.11.0](https://github.com/mqttjs/MQTT.js/compare/v5.10.4...v5.11.0) (2025-04-10)


### Bug Fixes

* correct return type of `validateTopis` to include `null` ([#1979](https://github.com/mqttjs/MQTT.js/issues/1979)) ([935784a](https://github.com/mqttjs/MQTT.js/commit/935784aa8235fd9f38ac17820edf357ed7d5ab75))


### Features

* add intrinsic support for SOCKS proxies ([#1966](https://github.com/mqttjs/MQTT.js/issues/1966)) ([ee0fcce](https://github.com/mqttjs/MQTT.js/commit/ee0fcce4bd3e1af318b0144b9e0928c571c02173))

## [5.10.4](https://github.com/mqttjs/MQTT.js/compare/v5.10.3...v5.10.4) (2025-02-26)


4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -429,6 +429,8 @@ The arguments are:
CONNACK is received
- `username`: the username required by your broker, if any
- `password`: the password required by your broker, if any
- `socksProxy`: establish TCP and TLS connections via a socks proxy (URL, supported protocols are `socks5://`, `socks5h://`, `socks4://`, `socks4a://`)
- `socksTimeout`: timeout for connecting to the socks proxy
- `incomingStore`: a [Store](#store) for the incoming packets
- `outgoingStore`: a [Store](#store) for the outgoing packets
- `queueQoSZero`: if connection is broken, queue outgoing QoS zero messages (default `true`)
@@ -486,6 +488,8 @@ The arguments are:
- `forceNativeWebSocket`: set to true if you're having detection issues (i.e. the `ws does not work in the browser` exception) to force the use of native WebSocket. It is important to note that if set to true for the first client created, then all the clients will use native WebSocket. And conversely, if not set or set to false, all will use the detection result.
- `unixSocket`: if you want to connect to a unix socket, set this to true
Instead of setting `socksProxy` you can also supple the same parameter via the environment variable `MQTTJS_SOCKS_PROXY`.
In case mqtts (mqtt over tls) is required, the `options` object is passed through to [`tls.connect()`](http://nodejs.org/api/tls.html#tls_tls_connect_options_callback). If using a **self-signed certificate**, set `rejectUnauthorized: false`. However, be cautious as this exposes you to potential man in the middle attacks and isn't recommended for production.

For those supporting multiple TLS protocols on a single port, like MQTTS and MQTT over WSS, utilize the `ALPNProtocols` option. This lets you define the Application Layer Protocol Negotiation (ALPN) protocol. You can set `ALPNProtocols` as a string array, Buffer, or Uint8Array based on your setup.
20 changes: 20 additions & 0 deletions esbuild.js
Original file line number Diff line number Diff line change
@@ -44,6 +44,26 @@ const options = {
)
}
},
{
name: 'resolve-socks',
setup(build) {
// socks is not supported in the browser and adds several 100kb to the build, so stub it
build.onResolve({ filter: /socks$/ }, args => {
return {
path: args.path,
namespace: 'socks-stub'
}
})

build.onLoad({ filter: /.*/, namespace: 'socks-stub' }, args => {
return {
contents: 'module.exports = {}',
loader: 'js'
}
}
)
}
},
],
}

Loading