4

I am setting up an express server with http-proxy-middleware. When requesting from the proxy, the request goes on until it finally times out.

The URL I try to proxy is https://www.pegelonline.wsv.de/, especially a WFS it provides. I've read the docs, and the TL;DR seems to apply for my case since I don't aim to do anything special that's listed. I've also tried the shorthand.

https://github.com/chimurai/http-proxy-middleware#tldr

Minimal example:

https://github.com/isthisstackoverflow/repro-waterlevel

const proxy = require('http-proxy-middleware')
const express = require('express')

const app = express()
const port = 9004

app.use(
  '/',
  proxy({
    target: 'https://www.pegelonline.wsv.de/',
    changeOrigin: true
  })
)

app.listen(port)

https://pegelonline.wsv.de/webservices/gis/aktuell/wfs?service=wfs&version=1.1.0&request=GetFeature&typeName=gk:waterlevels&outputFormat=json&Filter=%3CFilter%3E%3COr%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Ewater%3C/PropertyName%3E%3CLiteral%3EESTE%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Or%3E%3C/Filter%3E

^ Result is as expected.

http://localhost:9004/webservices/gis/aktuell/wfs?service=wfs&version=1.1.0&request=GetFeature&typeName=gk:waterlevels&outputFormat=json&Filter=%3CFilter%3E%3COr%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Ewater%3C/PropertyName%3E%3CLiteral%3EESTE%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Or%3E%3C/Filter%3E

^ Timeout eventually.

Update

I figure the problem is me trying to proxy https to http. I don't know what exactly the problem was and no longer need to do this, though.

quick_dough
  • 76
  • 1
  • 6

0 Answers0