Skip to content

Commit

Permalink
fix: support for use behind https (#664)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldaf authored and hacdias committed Jun 29, 2018
1 parent 93bae0c commit 02841eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/js/components/ipfs.js
Expand Up @@ -6,7 +6,7 @@ const host = (process.env.NODE_ENV !== 'production') ? 'localhost' : window.loca
const port = (process.env.NODE_ENV !== 'production') ? '5001' : (window.location.port || (window.location.protocol === 'https:' ? 443 : 80))
const protocol = (process.env.NODE_ENV !== 'production') ? 'http' : (window.location.protocol === 'https:' ? 'https' : 'http')

const ipfs = require('ipfs-api')(host, port, protocol)
const ipfs = require('ipfs-api')(host, port, {protocol: protocol})

let version = ''
let gateway = '//127.0.0.1:8080'
Expand Down
4 changes: 3 additions & 1 deletion src/js/services/api.js
Expand Up @@ -4,7 +4,9 @@ import {join} from 'path'

const host = (process.env.NODE_ENV !== 'production') ? 'localhost' : window.location.hostname
const port = (process.env.NODE_ENV !== 'production') ? '5001' : (window.location.port || (window.location.protocol === 'https:' ? 443 : 80))
const localApi = new API(host, port)
const protocol = (process.env.NODE_ENV !== 'production') ? 'http' : (window.location.protocol === 'https:' ? 'https' : 'http')

const localApi = new API(host, port, {protocol: protocol})

// -- Public Interface

Expand Down

0 comments on commit 02841eb

Please sign in to comment.