Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix support for use behind https #664

Merged
merged 2 commits into from
Jun 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/js/components/ipfs.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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