Skip to content

Commit

Permalink
use legacyCreateProxyMiddleware
Browse files Browse the repository at this point in the history
  • Loading branch information
kvnp committed Aug 24, 2024
1 parent 28f0dcc commit 6c4a1c1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions web/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const express = require('express');
const path = require('path');
const fs = require("fs");
const { createProxyMiddleware } = require('http-proxy-middleware');
const { legacyCreateProxyMiddleware } = require('http-proxy-middleware');
const { getTags, getLyrics } = require("./request");
const app = express();

Expand Down Expand Up @@ -46,7 +46,7 @@ app.get("/playlist/", function(req, res, next) {
.catch(err => res.send({err}));
});

app.use('/proxy/videoplayback', createProxyMiddleware({
app.use('/proxy/videoplayback', legacyCreateProxyMiddleware({
target: "https://redirector.googlevideo.com",
changeOrigin: true,
secure: false,
Expand All @@ -60,7 +60,7 @@ app.use('/proxy/videoplayback', createProxyMiddleware({
pathRewrite: {'^/proxy' : ''}
}));

app.use('/proxy/lh3', createProxyMiddleware({
app.use('/proxy/lh3', legacyCreateProxyMiddleware({
target: "https://lh3.googleusercontent.com",
changeOrigin: true,
pathRewrite: {'^/proxy/lh3/' : ''},
Expand All @@ -72,7 +72,7 @@ app.use('/proxy/lh3', createProxyMiddleware({
}
}));

app.use('/proxy/vi', createProxyMiddleware({
app.use('/proxy/vi', legacyCreateProxyMiddleware({
target: "https://i.ytimg.com",
changeOrigin: true,
pathRewrite: {'^/proxy' : ''},
Expand All @@ -84,7 +84,7 @@ app.use('/proxy/vi', createProxyMiddleware({
}
}));

app.use('/proxy', createProxyMiddleware({
app.use('/proxy', legacyCreateProxyMiddleware({
target: "https://music.youtube.com",
changeOrigin: true,
pathRewrite: {'^/proxy' : ''},
Expand Down

0 comments on commit 6c4a1c1

Please sign in to comment.