xvzc / SpoofDPI

A simple and fast anti-censorship tool written in Go
Apache License 2.0
3.53k stars 251 forks source link

Can't change port #223

Closed alotofthingstodo closed 1 month ago

alotofthingstodo commented 1 month ago

Version

0.11.1

Operating System

Ubuntu 24.04

How are you running SpoofDPI?

Through the command spoofdpi in Terminal. I installed it through curl -fsSL https://raw.githubusercontent.com/xvzc/SpoofDPI/main/install.sh | bash -s linux-amd64

Description

My wifi blocks all but a few ports and I don't have a way to change it, so I tried to change ports in Spoofdpi settings but got this error. spoofdpi -port int 80 invalid value "int" for flag -port: parse error.

Ledorub commented 1 month ago

int is a hint of the type of a value you are supposed to provide, you don't have to include it. -port 80, where 80 is an integer.

xvzc commented 1 month ago

I think we should add some example usage..

alotofthingstodo commented 1 month ago

int is a hint of the type of a value you are supposed to provide, you don't have to include it. -port 80, where 80 is an integer.

I got it, but there is an error.

FTL 2024-08-30T11:11:53+03:00 [PROXY] error creating listener: listen tcp 127.0.0.1:80: bind: permission denied

Ledorub commented 1 month ago

Try with a port greater than 1023.

alotofthingstodo commented 1 month ago

Try with a port greater than 1024.

It works, but it's of no use to me, because my wifi owner blocked access to all ports apart from 80 and 443.

Ledorub commented 1 month ago

You need elevated privileges to bind to ports in range 1-1023.

alotofthingstodo commented 1 month ago

You need elevated privileges to bind to ports in range 1-1023.

Please explain to me how to get them.

Ledorub commented 1 month ago

Prepend sudo, it will ask you for root password.

alotofthingstodo commented 1 month ago

Prepend sudo, it will ask you for root password.

I got elevated rights and set up port 80 successfully but when I enter google-chrome --proxy-server="http://127.0.0.1:80" I got the error below.

^Croot@Vivobook:~google-chrome --proxy-server="http://127.0.0.1:80"
[28104:28104:0830/114103.602818:ERROR:zygote_host_impl_linux.cc(99)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
root@Vivobook:~# ^C
root@Vivobook:~# google-chrome --proxy-server="http://127.0.0.1:80"
[28252:28252:0830/114134.539163:ERROR:zygote_host_impl_linux.cc(99)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
xvzc commented 1 month ago

for your safety, I don't recommend you running spoofdpi with port number under 1024, which requires root permission.

alotofthingstodo commented 1 month ago

Prepend sudo, it will ask you for root password.

That's what I get with FIrefox.

firefox --proxy-server="http://127.0.0.1:80"^Croot@Vivobook:~# 
root@Vivobook:~# firefox --proxy-server="http://127.0.0.1:80"
mkdir: cannot create directory ‘/run/user/0’: Permission denied
Authorization required, but no authorization protocol specified
Error: cannot open display: :0
root@Vivobook:~# firefox --proxy-server="http://127.0.0.1:80"
mkdir: cannot create directory ‘/run/user/0’: Permission denied
Authorization required, but no authorization protocol specified
Error: cannot open display: :0