7

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.

6
  • @BadrBellaj it is not applicable. It's not chrome that is doing it anymore. I have it already disabled it and remix started redirecting automatically now.
    – Fábio
    Commented Aug 14, 2019 at 9:55
  • why not to use remix localy
    – Badr Bellaj
    Commented Aug 14, 2019 at 10:12
  • It is not as practical as using it remotely, we don't need to fire a webserver and lastly no need to update. The way I resolved now is by allowing mixed content, which works.
    – Fábio
    Commented Aug 14, 2019 at 11:04
  • 1
    @MarcoOttolini Guillermo's answer below is what I am talking about.
    – Fábio
    Commented Aug 15, 2019 at 13:05

4 Answers 4

1

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.

1

The way to continue using Remix with a local Web3 provider is Allowing mixed content. To allow it in Chrome try to connect to your local Web3 Provider in https://remix.ethereum.org, it will through an error but in the url bar right side it appears an icon where you can click an "Allow unsafe scripts"... it should connect. Don't know how to do it in Firefox...

2
  • So, your solution is 1) set up a local ethereum node 2) using metamask, connect to it over localhost:8545 and this would cause the Chrome icon to appear. Is it correct? I'm asking because I'm not using a local ethereum node for development... Commented Aug 19, 2019 at 6:39
  • I didn't used metamask, I connected it directly to the localhost node... but I'd say it's similar using Metamask Commented Aug 19, 2019 at 22:53
1

just remove the S from the https , as : http://remix.ethereum.org/ and it will work ^^

2
  • now it works, but at the time I posted the question didn't, obviously. So it seems they reverted back to the previous behaviour and don't force anymore to use https Commented Sep 1, 2021 at 16:03
  • Yes, Loading remix IDE with http is required in case you want to connect with External HTTP provider under Environment setting in remix IDE. Commented Dec 3, 2022 at 11:26
0

To solve my problem I used a quick and dirty solution, similar to the trick used in hellopeach answer but doesn't provide you the remix interface.

  1. set up a virtual local server on port 80 for remix.ethereum.org. Put in the document root a simple valid index.html
  2. edit the hosts file to add a reference to remix.ethereum.org for 127.0.0.1
  3. restart the web server and direct your Chrome to http://remix.ethereum.org
  4. inspect the page and in the localStorage you'll find your contracts. You can then copy manually those you are interested in

If you want you can even write a simple script that iterates over all items in the localStorage and add them to the DOM in the index.html, but in that case is not "quick" anymore and then hellopeach answer would be better and faster, probably.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.