bulletmark / corsproxy

A simple CORS proxy server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No Target Host Mappings Defined

B-Mqn opened this issue · comments

commented

I have a rPI 2 B running Bullseye Fresh install.
have installed corsproxy via Readme.
it all works fine and running the proxy from the CLI I can get the proxy to work but when I add the IP's to the config file it errors
vim ~/.config/corsproxy # Add the target servers
the contents of the config file are
8000:192.168.1.111
but checking status get the error : No target host mappings defined
Guessing I have put the data in the file incorrectly?
the port and ip work fine from the command line when entering as
./corsproxy 8000:192.168.1.111

root@raspberrypi:~# systemctl status corsproxy
● corsproxy.service - CORS Proxy Service
     Loaded: loaded (/etc/systemd/system/corsproxy.service; enabled; vendor pre>
     Active: failed (Result: exit-code) since Sat 2022-01-22 13:22:51 ACDT; 1h >
    Process: 322 ExecStart=/home/pi/corsproxy/corsproxy (code=exited, status=2)
   Main PID: 322 (code=exited, status=2)
        CPU: 4.654s

Jan 22 13:22:42 raspberrypi systemd[1]: Started CORS Proxy Service.
Jan 22 13:22:51 raspberrypi corsproxy[322]: usage: corsproxy [-h] [targets ...]
Jan 22 13:22:51 raspberrypi corsproxy[322]: corsproxy: error: No target host ma>
Jan 22 13:22:51 raspberrypi systemd[1]: corsproxy.service: Main process exited,>
Jan 22 13:22:51 raspberrypi systemd[1]: corsproxy.service: Failed with result '>
Jan 22 13:22:51 raspberrypi systemd[1]: corsproxy.service: Consumed 4.654s CPU >
lines 1-13/13 (END)

So given you followed the procedure and it worked this time I guess we can close your original issue #1?

As the instructions say, you can enter mappings either with spaces between them, or on different lines, etc so I doubt you have that incorrect. It is far more likely you have placed the configuration file in the wrong place. Given you have run the program as user "pi" then the config file should be at /home/pi/.config/corsproxy. Please check that. Note that the Linux shell aliases ~ as a shorthand for the home directory of the user, i.e. /home/pi in this case.

commented

"So given you followed the procedure and it worked this time I guess we can close your original issue #1?"

still have that issue on the other sd card. im guessing updating from wheezy to jessie to stretch to then buster something has gone astray. but yes close it
I started with a new image and everything works as expected so something wrong with the other image. going to have to try and get my other software running on this image... (seems to be just as challenging)

the .config/corsproxy was in root.
have changed it to /home/pi/.config/corsproxy now and works. cheers
im guessing since I done that step later I wasn't in the right directory before issuing the command...

thanks for all your help

If you were logged in as user pi and you edited that file, e.g. vim ~/.config/corsproxy, then it would have been pointing to the correct file. You must have done it as root. Generally, avoid doing much in root on Linux systems. Work as your normal user and just use sudo for the occasional root command when needed.