
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
react-ssl-redirect
Advanced tools
redirect react-app to SSL version.
This is a simple javascript function and it should work for any javascript app including react, angular, vanilla javascript, vue, or any other js library.
npm install react-ssl-redirect
if you're using react, simply add it to your src/index prior to calling any other function or component.
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter } from "react-router-dom";
import App from "./app";
// Redux
import { Provider } from "react-redux";
import store from "./redux/store";
// Setup
import axios from "axios";
import dotenv from "dotenv";
import ReactSSLRedirect from "react-ssl-redirect";
ReactSSLRedirect(); // <------ will redirect as soon as page is loaded.
dotenv.config();
axios.defaults.baseURL = process.env.REACT_APP_SERVER;
ReactDOM.render(
<Provider store={store}>
<BrowserRouter>
<App />
</BrowserRouter>
</Provider>,
document.querySelector("#root")
);
by default, this package skip hostname that equals to "localhost". This means, if you are on localhost, you will not be redirected. If you want overide this, you may add the following argument.
{
exceptions: ["hostname_to_skip"]
}
by default, you will be redirected to https version of your platform. For example, http://www.google.com, will be redirected to https://www.google.com
if you want to overide this. You must include the following:
{
redirect_to: "https://www.different_link.com"
}
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter } from "react-router-dom";
import App from "./app";
// Redux
import { Provider } from "react-redux";
import store from "./redux/store";
// Setup
import axios from "axios";
import dotenv from "dotenv";
import ReactSSLRedirect from "react-ssl-redirect";
ReactSSLRedirect({
exceptions: ["localhost", "dev"],
redirect_to: "https://www.somewhere.com"
});
dotenv.config();
axios.defaults.baseURL = process.env.REACT_APP_SERVER;
ReactDOM.render(
<Provider store={store}>
<BrowserRouter>
<App />
</BrowserRouter>
</Provider>,
document.querySelector("#root")
);
FAQs
Redirect to HTTP to HTTPS
We found that react-ssl-redirect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.