Skip to content

Instantly share code, notes, and snippets.

@auggod
Last active April 30, 2016 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save auggod/019aa5eee8ef618dcf65678e4649d8a7 to your computer and use it in GitHub Desktop.
Save auggod/019aa5eee8ef618dcf65678e4649d8a7 to your computer and use it in GitHub Desktop.
Get around Soundcloud Safari, iOS bug. See issue: https://github.com/soundcloud/soundcloud-javascript/issues/27
server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/certs/tracklist.crt;
ssl_certificate_key /etc/ssl/private/tracklist.key;
server_name proxy.yourapp.com;
location / {
allow all;
proxy_set_header X_FORWARDED_PROTO https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Url-Scheme $scheme;
proxy_redirect off;
proxy_max_temp_file_size 0;
proxy_http_version 1.1;
proxy_pass http://localhost:8081;
}
}
const request = require('request')
const express = require('express')
const cors = require('cors')
const app = express()
app.use(cors())
app.get('/', (req, res) => {
var url = req.query.url
request({ method: 'GET',
uri: url,
gzip: true,
json: true
}, (error, response, body) => {
if (error) throw error
res.json(body)
})
})
app.listen(8081)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment