go-proxy starts but does not work #3

Closed
opened 2025-12-29 09:21:31 +01:00 by adam · 9 comments
Owner

Originally created by @earvingad on GitHub (Mar 28, 2024).

Hello, the program seems to start but it does not work.

Config file content:

providers:
  eee:
    kind: file
    value: eee.yml

Provider eee.yml:

eee: # matching `app1.y.z` -> http://x.y.z
  host: eee.service.lan
  port: 8000

when running sudo /bin/go-proxy I get the following log:

WARN[03-27 21:09:26] invalid autocert config
- no domains specified
- no provider specified
- no email specified
- unknown provider:  component=autocert
INFO[03-27 21:09:26] starting http proxy server on :80
INFO[03-27 21:09:26] starting http panel server on :8080
INFO[03-27 21:09:26] loaded 1 proxy configurations                 component=provider kind=file name=eee

but when I try to enter eee.service.lan I get "enable to connect" and I cannot access 10.0.1.240:8080.
Local DNS is correctly pointing eee.service.lan to 10.0.1.240.

I don't know what I am missing.

Originally created by @earvingad on GitHub (Mar 28, 2024). Hello, the program seems to start but it does not work. Config file content: ```yml providers: eee: kind: file value: eee.yml ``` Provider eee.yml: ```yml eee: # matching `app1.y.z` -> http://x.y.z host: eee.service.lan port: 8000 ``` when running `sudo /bin/go-proxy` I get the following log: ```shell WARN[03-27 21:09:26] invalid autocert config - no domains specified - no provider specified - no email specified - unknown provider: component=autocert INFO[03-27 21:09:26] starting http proxy server on :80 INFO[03-27 21:09:26] starting http panel server on :8080 INFO[03-27 21:09:26] loaded 1 proxy configurations component=provider kind=file name=eee ``` but when I try to enter eee.service.lan I get "enable to connect" and I cannot access `10.0.1.240:8080`. Local DNS is correctly pointing eee.service.lan to 10.0.1.240. I don't know what I am missing.
adam closed this issue 2025-12-29 09:21:31 +01:00
Author
Owner

@yusing commented on GitHub (Mar 28, 2024):

Hi, thanks for trying go-proxy out. A few questions I want to ask:

  • What is the IP address of the machine you run go-proxy? Is it really 10.0.1.240?
  • Can you curl port 80 and 8080 on the same machine you run go-proxy?
  • Can your client machine (which u tried to access eee.service.lan) ping 10.0.1.240?
  • Why do you set host: to eee.service.lan? Do you want to proxy to port 8000 of the same machine?
@yusing commented on GitHub (Mar 28, 2024): Hi, thanks for trying `go-proxy` out. A few questions I want to ask: - What is the IP address of the machine you run `go-proxy`? Is it really `10.0.1.240`? - Can you curl port 80 and 8080 on the same machine you run `go-proxy`? - Can your client machine (which u tried to access `eee.service.lan`) ping `10.0.1.240`? - Why do you set `host:` to `eee.service.lan`? Do you want to proxy to port 8000 of the same machine?
Author
Owner

@yusing commented on GitHub (Mar 28, 2024):

I'm sure both your config and eee.yml is valid, seems like it's a connection problem between your machines

@yusing commented on GitHub (Mar 28, 2024): I'm sure both your config and `eee.yml` is valid, seems like it's a connection problem between your machines
Author
Owner

@earvingad commented on GitHub (Mar 28, 2024):

Hi, thanks for trying go-proxy out. A few questions I want to ask:

* What is the IP address of the machine you run `go-proxy`? Is it really `10.0.1.240`?

* Can your client machine (which u tried to access `eee.service.lan`) ping `10.0.1.240`?

* Why do you set `host:` to `eee.service.lan` you want to proxy to port 8000 of the same machine?
  • yes, the machine running go-proxy is 10.0.1.240
  • yes, I can ping 10.0.1.240 and also nslookup or dig reach eee.service.lan to 10.0.1.240
  • tried with host: 10.0.1.240 with the same result. And yes, trying to proxy to port 8000 on the same machine running go-proxy.

Additionally, where should I set the domain "service.lan" so the subdomain like eee.service.lan resolves correctly of I use host: 10.0.1.240 in the eee.yml? Documentation is not clear.

I cannot Access 10.0.1.240:8080 or 127.0.0.1:8080 on the same machine running go-proxy.

@earvingad commented on GitHub (Mar 28, 2024): > Hi, thanks for trying `go-proxy` out. A few questions I want to ask: > > * What is the IP address of the machine you run `go-proxy`? Is it really `10.0.1.240`? > > * Can your client machine (which u tried to access `eee.service.lan`) ping `10.0.1.240`? > > * Why do you set `host:` to `eee.service.lan` you want to proxy to port 8000 of the same machine? - yes, the machine running go-proxy is 10.0.1.240 - yes, I can ping 10.0.1.240 and also nslookup or dig reach eee.service.lan to 10.0.1.240 - tried with host: 10.0.1.240 with the same result. And yes, trying to proxy to port 8000 on the same machine running go-proxy. Additionally, where should I set the domain "service.lan" so the subdomain like eee.service.lan resolves correctly of I use host: 10.0.1.240 in the eee.yml? Documentation is not clear. I cannot Access 10.0.1.240:8080 or 127.0.0.1:8080 on the same machine running go-proxy.
Author
Owner

@yusing commented on GitHub (Mar 28, 2024):

I have tried to replicate your config and provider file on a new LXC container, and I found a bug it mistakenly redirected to https even if no cert loaded. But it is not your case, mine showing <a href="https://localhost/?">Moved Permanently</a>.

I cannot Access 10.0.1.240:8080 or 127.0.0.1:8080 on the same machine running go-proxy.

What is the output of curl 127.0.0.1:8080?

@yusing commented on GitHub (Mar 28, 2024): I have tried to replicate your config and provider file on a new LXC container, and I found a bug it mistakenly redirected to https even if no cert loaded. But it is not your case, mine showing `<a href="https://localhost/?">Moved Permanently</a>.` > I cannot Access 10.0.1.240:8080 or 127.0.0.1:8080 on the same machine running go-proxy. What is the output of `curl 127.0.0.1:8080`?
Author
Owner

@earvingad commented on GitHub (Mar 28, 2024):

I have tried to replicate your config and provider file on a new LXC container, and I found a bug it mistakenly redirected to https even if no cert loaded. But it is not your case, mine showing <a href="https://localhost/?">Moved Permanently</a>.

I cannot Access 10.0.1.240:8080 or 127.0.0.1:8080 on the same machine running go-proxy.

What is the output of curl 127.0.0.1:8080?

Yes! That same results I get when I use curl. Webbrowser will just error the connection.

@earvingad commented on GitHub (Mar 28, 2024): > I have tried to replicate your config and provider file on a new LXC container, and I found a bug it mistakenly redirected to https even if no cert loaded. But it is not your case, mine showing `<a href="https://localhost/?">Moved Permanently</a>.` > > > I cannot Access 10.0.1.240:8080 or 127.0.0.1:8080 on the same machine running go-proxy. > > What is the output of `curl 127.0.0.1:8080`? Yes! That same results I get when I use curl. Webbrowser will just error the connection.
Author
Owner

@yusing commented on GitHub (Mar 28, 2024):

Yes! That same results I get when I use curl. Webbrowser will just error the connection.

So I want to get the exact output of curl, to figure out what error is.

I submitted a commit to fix incorrect http -> https redirect when no cert is provided, please run git pull and try again to see if it work now.

@yusing commented on GitHub (Mar 28, 2024): > Yes! That same results I get when I use curl. Webbrowser will just error the connection. So I want to get the exact output of curl, to figure out what error is. I submitted a commit to fix incorrect http -> https redirect when no cert is provided, please run `git pull` and try again to see if it work now.
Author
Owner

@yusing commented on GitHub (Mar 28, 2024):

image

@yusing commented on GitHub (Mar 28, 2024): ![image](https://github.com/yusing/go-proxy/assets/23052124/c9733d8c-0ee3-4bd1-9919-25f9f9d24e9d)
Author
Owner

@yusing commented on GitHub (Mar 28, 2024):

Additionally, where should I set the domain "service.lan" so the subdomain like eee.service.lan resolves correctly of I use host: 10.0.1.240 in the eee.yml? Documentation is not clear.

As the README shows, domain name does not matter. As long as the DNS resolve eee.service.lan or *.service.lan into 10.0.1.240, you can access all of them.

A simple way to do this, is to set the A record of *.service.lan in your DNS to 10.0.1.240. Then all subdomain to service.lan will resolve to 10.0.1.240. For example:

image

@yusing commented on GitHub (Mar 28, 2024): > Additionally, where should I set the domain "service.lan" so the subdomain like eee.service.lan resolves correctly of I use host: 10.0.1.240 in the eee.yml? Documentation is not clear. As the README shows, **domain name does not matter**. As long as the DNS resolve eee.service.lan or *.service.lan into 10.0.1.240, you can access all of them. A simple way to do this, is to set the A record of `*.service.lan` in your DNS to 10.0.1.240. Then all subdomain to `service.lan` will resolve to 10.0.1.240. For example: ![image](https://github.com/yusing/go-proxy/assets/23052124/7bd4c07d-003b-46e2-8c12-d74561392d41)
Author
Owner

@earvingad commented on GitHub (Mar 28, 2024):

Thanks for the help, it is working correctly now!
Curl before fix:

curl localhost:8080                                      

<a href="https://localhost:8080/?">Moved Permanently</a>.

After fix it is correctly working:

curl localhost:8080       

!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="style.css" rel="stylesheet" />
    <title>go-proxy</title>
  </head>
  <body>
    <script src="main.js"></script>
    <div id="sidenav" class="sidenav">
      <a href="javascript:void(0)" class="closebtn" onclick="closeNav()"
        >&times;</a
      >
      ....

Thanks a lot!

@earvingad commented on GitHub (Mar 28, 2024): Thanks for the help, it is working correctly now! Curl before fix: ```shell curl localhost:8080 <a href="https://localhost:8080/?">Moved Permanently</a>. ``` After fix it is correctly working: ```shell curl localhost:8080 !DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link href="style.css" rel="stylesheet" /> <title>go-proxy</title> </head> <body> <script src="main.js"></script> <div id="sidenav" class="sidenav"> <a href="javascript:void(0)" class="closebtn" onclick="closeNav()" >&times;</a > .... ``` Thanks a lot!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/godoxy#3