Remix Ethereum – How to Continue Using HTTP Instead of Mandatory HTTPS?

remix

Recently I was able to both use http://remix.ethereum.org or https://remix.ethereum.org, but today I was not able to direct by browser to the unsecure version of remix. The reason I need to do so is because I have many contracts there and I would like to access them and eventually transfer them to the "secure" version.

I checked the request sent to remix with http and the response is a 301 Moved Permanently to https. I also receive the error message: "You are using an https connection. Please switch to http if you are using Remix against an http Web3 provider or allow Mixed Content in your browser.", but this doesn't give me a clue on how to solve the problem.

Is there a way to force remix to use http instead of https?
I'm using a Chrome browser on a Mac.

Best Answer

If you just want to recover your contracts and migrate them to the secure version, you can run Remix IDE locally and change the hosts file to point remix.ethereum.org to your local machine. The steps are as follows:

  1. Install nodejs. There are many ways of doing this on a Mac, I prefer to use nvm (https://github.com/nvm-sh/nvm/blob/master/README.md)

  2. Install the remix-ide server by running npm install -g remix-ide

  3. edit the hosts file by running sudo nano /etc/hosts and then add the line 127.0.0.1 remix.ethereum.org to the end of the file

  4. By default the remix-ide listens on port 8080, so now you have two options, the first is to setup a reverse proxy like nginx to forward request on port 80 to port 8080, and then start the remix-ide normally. I won't go over the details on how to setup a reverse proxy, if you are not familiar with them you can just do the quick hack below since it's just a temporary way for you to access your stored smart contracts.

    The second option is to edit the remix-ide start script by running nano -w `which remix-ide` and replace all the 8080 to 80, and then start the modified start script by running sudo remix-ide

  5. Either way, now you can start your browser and navigate to http://remix.ethereum.org and it will show the site served by the local server without https and hopefully you can find all the smart contracts stored there.

Related Topic