Wildcards in the node-http-proxy router table

can someone tell me how to use wildcards in the router table node-http-proxy?

for example, for wildcard subdomains, something like * .domain.de
I know there is RegEx, but I can't get it to work.
I tried how

'([a-zA-Z0-9_]).domain.de': '127.0.0.1:8085',

and

 '([^.]*).domain.de' : '127.0.0.1:8085'

but no one redirects.

+3
source share
1 answer

I did not do this myself, but I think the whole line should be a regular expression. So it will be something like:

'[a-zA-Z0-9_]\.domain\.de': '127.0.0.1:8085',

Pay attention to the screening of points. In fact, it would be easier (although perhaps not so safe) if this format is correct:

'.*\.domain\.de': '127.0.0.1:8085',

Or even:

'\w*\.domain\.de': '127.0.0.1:8085',

, Node, "" - , :( , , Node .

+3

All Articles