diff --git a/benchmarks/http-proxy.js b/benchmarks/http-proxy.js index 0bb53bb..ff9a748 100644 --- a/benchmarks/http-proxy.js +++ b/benchmarks/http-proxy.js @@ -1,7 +1,7 @@ 'use strict' const httpProxy = require('http-proxy') -const { Agent } = require('http') +const { Agent } = require('node:http') const proxy = httpProxy.createProxyServer({ target: 'http://localhost:3001', diff --git a/index.js b/index.js index 701451f..b2752f2 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ 'use strict' const From = require('@fastify/reply-from') -const { ServerResponse } = require('http') +const { ServerResponse } = require('node:http') const WebSocket = require('ws') const { convertUrlToWebSocket } = require('./utils') const fp = require('fastify-plugin') diff --git a/test/socket.io.js b/test/socket.io.js index bc9d1f9..2051625 100644 --- a/test/socket.io.js +++ b/test/socket.io.js @@ -5,9 +5,9 @@ const Fastify = require('fastify') const proxy = require('../') const ioServer = require('socket.io') const ioClient = require('socket.io-client') -const { createServer } = require('http') -const { promisify } = require('util') -const { once } = require('events') +const { createServer } = require('node:http') +const { promisify } = require('node:util') +const { once } = require('node:events') test('proxy socket.io', async t => { t.plan(2) diff --git a/test/test.js b/test/test.js index b0ba5ca..1c33afd 100644 --- a/test/test.js +++ b/test/test.js @@ -5,7 +5,7 @@ const Fastify = require('fastify') const proxy = require('../') const got = require('got') const { Unauthorized } = require('http-errors') -const Transform = require('stream').Transform +const Transform = require('node:stream').Transform async function run () { const origin = Fastify() diff --git a/test/websocket.js b/test/websocket.js index a265d35..055dc1d 100644 --- a/test/websocket.js +++ b/test/websocket.js @@ -4,9 +4,9 @@ const { test } = require('tap') const Fastify = require('fastify') const proxy = require('../') const WebSocket = require('ws') -const { createServer } = require('http') -const { promisify } = require('util') -const { once } = require('events') +const { createServer } = require('node:http') +const { promisify } = require('node:util') +const { once } = require('node:events') const cookieValue = 'foo=bar' const subprotocolValue = 'foo-subprotocol' diff --git a/test/ws-prefix-rewrite-core.js b/test/ws-prefix-rewrite-core.js index b6712ad..ccbd4ae 100644 --- a/test/ws-prefix-rewrite-core.js +++ b/test/ws-prefix-rewrite-core.js @@ -1,7 +1,7 @@ 'use strict' const t = require('tap') -const { once } = require('events') +const { once } = require('node:events') const Fastify = require('fastify') const fastifyWebSocket = require('@fastify/websocket') diff --git a/test/ws-prefix-rewrite.js b/test/ws-prefix-rewrite.js index abb590d..58af545 100644 --- a/test/ws-prefix-rewrite.js +++ b/test/ws-prefix-rewrite.js @@ -1,7 +1,7 @@ 'use strict' const t = require('tap') -const { once } = require('events') +const { once } = require('node:events') const Fastify = require('fastify') const fastifyWebSocket = require('@fastify/websocket')