From 12801f2faaf3e901c7e64e7446ef48444f7b8e87 Mon Sep 17 00:00:00 2001 From: radicalrob Date: Sun, 14 Aug 2016 20:20:27 +0000 Subject: [PATCH] added configs for running locally with orthanc via DIMSE --- config/localhostOrthancDIMSE.json | 41 +++++++++++++++++++++++++++++++ etc/AscendAWS_CORSProxy.js | 20 +++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 config/localhostOrthancDIMSE.json create mode 100644 etc/AscendAWS_CORSProxy.js diff --git a/config/localhostOrthancDIMSE.json b/config/localhostOrthancDIMSE.json new file mode 100644 index 000000000..b10821a25 --- /dev/null +++ b/config/localhostOrthancDIMSE.json @@ -0,0 +1,41 @@ +{ + "servers": { + "dicomWeb": [ + { + "name": "Orthanc", + "wadoUriRootNOTE" : "either this uri is not correct for wado-uri or wado-uri is not configured on orthanc currently", + "wadoUriRoot" : "http://52.87.58.190:8043/wado", + "qidoRoot": "http://localhost:8042/dicom-web", + "wadoRoot": "http://localhost:8042/dicom-web", + "qidoSupportsIncludeField": false, + "imageRendering" : "wadouri", + "requestOptions" : { + "auth": "orthanc:orthanc", + "logRequests" : true, + "logResponses" : false, + "logTiming" : true + } + } + ], + "dimse": [{ + "name": "OrthancDIMSE", + "peers": [ + { + "host" : "localhost", + "port" : 4242, + "aeTitle" : "ORTHANC", + "default": true, + "supportsInstanceRetrievalByStudyUid": true + }, + { + "host" : "0.0.0.0", + "port" : 11112, + "aeTitle" : "OHIFDCM", + "default" : true, + "server" : true + } + ] + }] + }, + "defaultServiceType": "dimse" + } diff --git a/etc/AscendAWS_CORSProxy.js b/etc/AscendAWS_CORSProxy.js new file mode 100644 index 000000000..39db2762f --- /dev/null +++ b/etc/AscendAWS_CORSProxy.js @@ -0,0 +1,20 @@ +// This sets up a proxy to work around CORS. +// See http://chafey.blogspot.be/2014/09/working-around-cors.html +// For more information +var http = require('http'), + httpProxy = require('http-proxy'); + +var proxy = httpProxy.createProxyServer({ + target: 'http://172.31.7.135:8042', + auth: 'orthanc:orthanc' +}).listen(8043); + +proxy.on('proxyRes', function(proxyReq, req, res, options) { + // add the CORS header to the response + res.setHeader('Access-Control-Allow-Origin', '*'); +}); + +proxy.on('error', function(e) { + // suppress errors + console.log(e); +});