Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run on multiple ports #84

Closed
james12974 opened this issue Jun 5, 2018 · 13 comments
Closed

Run on multiple ports #84

james12974 opened this issue Jun 5, 2018 · 13 comments

Comments

@james12974
Copy link

How i can run on muliple ports with tags?
i ran it on a port and then i tried to run on another port that said port 8888 is already in use

@SimWhite
Copy link

SimWhite commented Jun 5, 2018

Running mproto-proxy --help will show the following:
--http-ports/-H <arg> comma-separated list of client (HTTP) ports to listen
So mtproto-proxy -H 443,8443 will run proxy on 443 and 8443 ports.

@james12974
Copy link
Author

yes but i cant see stats in bot

@SimWhite
Copy link

SimWhite commented Jun 5, 2018

You already have something on 8888 port. Read the help and change port 8888 to something else.

@james12974
Copy link
Author

so can i have stats for 2 ports?

@SimWhite
Copy link

SimWhite commented Jun 5, 2018

You can run two instances with the different anything: ports, tags, secrets and so on.

@james12974
Copy link
Author

sorry
i changed 8888 but bot did not give me any stats :(
but sponsor channel is ok

@D13410N3
Copy link

@james12974 you should establish connection using your INTERNAL port.
For example, external port (public, users should provide it in proxy-settings) is 1234 and your internal port is 5678.

Arguments will be: -H 1234 -p 5678

After running your server try to execute something like this:
curl localhost:5678/stats

Don't foreget to replace 5678 to your chosen internal port

@p1ratrulezzz
Copy link

Just use dnat in iptables to forward all input traffic on interface eth0 (example) and port 1234 with --redirect --to-ports 1235 .for me it worked well enough.

@NightMachinery
Copy link

NightMachinery commented Jun 26, 2018

@p1ratrulezzz Can you give the complete command? I tried iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to 8833 and sudo iptables -t nat -A OUTPUT -o lo -p tcp --dport 443 -j REDIRECT --to-port 8833 but they didn't work.
Update: iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8080 works.
Update: Actually the above command didn't work after I restarted docker and it added its own rules to iptables. I am going to try iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 443 -j DNAT --to-destination x.x.x.x:443 ...

@NightMachinery
Copy link

NightMachinery commented Jun 26, 2018

@james12974 How to use this -H from Docker?

@NightMachinery
Copy link

The best option is to simply use multiple -pPORT:443 options. 😐😂

@p1ratrulezzz
Copy link

p1ratrulezzz commented Jul 2, 2018

For port redirect:

iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 6968

That should do the job, but yes, you also can use multiple port options in -H

mtproto-proxy -H 443,6968

I bet the issue must be closed

@shadowlmd
Copy link

Please close this issue.

@stek29 stek29 closed this as completed Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants