ThauEx / ffrk-proxy

Proxy for Final Fantasy Record Keeper written in node.js
GNU Lesser General Public License v3.0
39 stars 21 forks source link

Requires port forwarding? #42

Closed VaelVictus closed 8 years ago

VaelVictus commented 8 years ago

Windows 10. Android 5.1.x.

I follow the steps and on my computer, start.bat shows:

_ffrk-proxy 0.6.2 started listening on: 0.0.0.0:5050 rootCA webserver started listening on: 0.0.0.0:5051 _

0.0.0.0 seems wrong but I ignore it. Now, no matter what I do on my phone, it simply won't connect with the proxy. My computer is wired into the router directly and the phone picks up the wifi. I wonder if the problem is that I "technically" have four WIFIs available on this network, all with the same IP, something about dual-band Netgear 5G.

I just want some insight as to what could be going wrong, perhaps you know if dual-band is or isn't working with this proxy. Also, this is the only way I've found to contact you, sorry.

Dragomitch commented 8 years ago

The problem is simply the fact the server is listening on 0.0.0.0 . Maybe try to reinstall it and disable your firewalls for the program. It should be your local address instead of 0.0.0.0

VaelVictus commented 8 years ago

Sure about that? All I did was install then start. When firewall came up, I allowed it. I even turned firewall completely off. As I go through the source code, I see that it logs 0.0.0.0 with console.log() as if it's intended to do that. You're saying yours doesn't say 0.0.0.0 when you run it?

I thought maybe it could be my localhost I've installed, WAMP, but WAMP listens on port 80 and I turned it off with the same result.

Dragomitch commented 8 years ago

Just relaunched my server and, in fact, i said something totally wrong. Sorry. I've the same displayed IP as you (0.0.0.0) . I just had found that odd ..

ThauEx commented 8 years ago

The ip 0.0.0.0 means that it is listening on all network interfaces (network cards like LAN or WIFI). Check out your computers up address, this is the up which you have to enter in your phone (not 0.0.0.0). I have not figured out how to get the computers up address. When the computer and phone are in the same network, there should be no issue. The 5g thing is, afaik only for connecting to the Internet and not important for us.

VaelVictus commented 8 years ago

Sorry, just to be sure: you mean IP address, not "up address"? I can't find anything on google for up address. I did put in its IP, and that's what brought me to the error I have now. I'll see what else I can do.

KHShadowrunner commented 8 years ago

Shouldn't need to be port forwarded - unless your router is configured to block cross talk (usually not done by default). IF anything, I'd imgaine it's the firewall on the PC, or the proxy settings on the device?

ThauEx commented 8 years ago

Yes, I mean ip address. Spell checker....

When starting the proxy the first time, the windows firewall should ask for permission.

VaelVictus commented 8 years ago

I've spent much too long on this and come to the conclusion it's my phone. Anyone working on a Sprint LG G3? The Sphinxara owner suggests some people's phones just don't accept FFRK proxies. Probably wrong, who knows. I did what I could.

VaelVictus commented 8 years ago

When one of you gets the time, you could write a more detailed explanation for how to connect the proxy. Stuff like ComputerIP:5051 can be construed as putting literally "ComputerIP:5051" into the address bar. Both my workplace network and my home didn't work for me, and I did check netstat -an in cmd to see that my ports are open. I feel like you're missing a step that not all users would necessarily need to do, but users like me would.

Windows 10, if it matters. Though the workplace computer is a windows 7.

ThauEx commented 8 years ago

Well... I thougth it is obvious that you have to enter your computers ip address instead of this name... You can use google to find our the ip address of your computer (I already did that for you: http://www.wikihow.com/Find-an-IP-Address) And this ip has to be entered into your phones browser with the port 5051, for example your ip address is 192.168.0.5, then you have to enter http://192.168.0.5:5051.

VaelVictus commented 8 years ago

Not obvious to some youngster who just wants to cheat on FFRK and has no experience with anything like this.

In my case, I sorta refuse to believe your code is perfect for all users, either through your own error or through technical limitations of the libraries you use. I'm not sure what it is about my phone that makes it difficult to connect, but if I had the most meticulous, detailed instructions, I'd at least believe it's not my own user error.

ThauEx commented 8 years ago

Just create some screenshots for me and I will try to help you. I need a screenshot of your computers ip address and your phones wifi configuration. Make sure, both are on the same network.

Dragomitch commented 8 years ago

In fact there's no reason to be a server problem. I think it's just you doing something wrong @VaelVictus . Any phone with a proxy configuration option could use a proxy like this one.

On the server ( computer wich is going to run the script ) : _Take the LAN IP address of the machine. (cf to internet for that) (probably something like 192.168.x.xx ) _Launch the script

On your phone(s) : _Go Into your Wireless connection settings for your local connection _Check advanced options _Proxy settings : manually Now, enter as proxy hostname the IP address of your server. As proxy port : 5050 As Bypass for : 127.0.0.1 _Save the settings and disconnect/reconnect the Wireless connection. _Go to browser, and type https://SERVER_LAN_ADDRESS:5051 This last step download the certificate. You are normally done.

For both ( LAN & Local ) make sure Firewalls aren't blocking the Proxy

For use the proxy over Internet now : _You should open ports 5050 and 5051 through your router (cf internet for you router for that) _Use your internet server address instead of local address for any Wifi external to your house.

I could help you in private if you want, for lesser notifications & better help. (Skype/Teamviewer)

KHShadowrunner commented 8 years ago

If you want to test it, i can point my external URL to a different port temporarily and you could test it against a confirmed working server - let us know if you want to go that route. That should help you confirm that it's the phone

VaelVictus commented 8 years ago

I'm happy to say I figured it out! I hope a proper FAQ can be written for the uber-noobs. I was just a little noob. ;} Turns out I was connecting on a guest network that I'd enabled, which didn't allow connecting to local servers. That was based in the router.

As for why it didn't work at my workplace, no idea. I put in my computer's IP address and followed the instructions as above. (users note: this is not the whatismyip.com address, it's what you find in Windows cmd and typing "ipconfig", looks like 192.168)

I hope my thread can be act as a debug thread for anyone stuck. :P Never pay for a proxy or resolve to use Sphinxara.

KHShadowrunner commented 8 years ago

Likely at work for the same reason you couldn't orignally at home - it's possible that your work environment has outright disabled proxy configurations from tunnelling through because it uses its own proxy. It's possible to configure a router to not allow proxies to work, it's just not the default. Since you dont have control of it, I bet it's configured to do that.

SirPhoenix88 commented 8 years ago

I am actually having issues with this now. My internet company brought me an "improved" modem/router, and I haven't been able to get my PC to see my phone, despite being on the same network. I've gone into the configuration, but there doesn't seem to be any blocks on ports.

VaelVictus commented 8 years ago

Just to be thorough: disabled your firewall?

Try going into Windows -> cmd and typing "netstat -an", see if ports 5050 and 5051 are open.

And you mean to say that the PC doesn't see your phone with the proxy, right? Not completely blind to your phone at all, because otherwise that's an entirely different issue.

zzxxzzxxSG commented 8 years ago

* FFRK-Proxy *

\ Discussion Forum ** https://www.alphagamers.net/threads/final-fantasy-record-keeper-proxy.20900/

\ Download Link ** https://github.com/ThauEx/ffrk-proxy/releases

Download The ZIP File For Your 32 Bit or 64 Bit System. Extract The ZIP File. Run "START.BAT"

\ Installation **

If you don't have "Nodejs" installed, run "install.bat", it will download a working version for you.

To start the proxy, run "start.bat". Your firewall ask for permission. Please ALLOW it. (A Window Will Pop UP) "Nodejs" has to open a port, where the server is running.

First Install "Nodejs" via package manager.

Just type "npm start" to run proxy. All modules are included, so please DO NOT UPDATE THEM!

\ Configuration ** Configure a proxy server on your phone/tablet.

WLAN > Select Your WIFI > Proxy: Manual > Server IP (Hostname) : IP Of Your PC (Usually 192.168.1.1xx) Server Port: 5050

(Bypass) Exclude for: 127.0.0.1

To install the root certificate, Type "ComputerIP:5051" (http://192.168.1.1xx:5051) On Your Phone's Browser. Accept the certificate installation. Your system could request you to set a security pattern (pin, password, etc), you have to complete this. You need to install the certificate, else it won't work.

\ Known bugs **

When reporting bugs, please tell me your server operating system+version and your android device+version.

\ Requirements **

\ Thanks To **

ThauEx commented 8 years ago

What?

zzxxzzxxSG commented 8 years ago

Above is my refined README. Feel free to use it or understand/edit it.

If you don't have "Nodejs" installed, run "install.bat", it will download a working version for you.

"Nodejs" has to open a port, where the server is running.

ThauEx commented 8 years ago

I made some changes and node js is now included in the windows releases. I will check the readme later...

VaelVictus commented 8 years ago

That's a good readme, zzxx.

ThauEx commented 8 years ago

Would be better to create a pull request for that or at least it's own issue...

RhaoG commented 8 years ago

enobufs

Hi Thau. What does this ENOBUFS screenshot mean?

ThauEx commented 8 years ago

Well the proxy is running on port 5050 and you try to access it while the proxy is enabled... What do you want to reach? The proxy is trying to proxy itself...

RhaoG commented 8 years ago

It happens when I try to reach Computer IP:5050 via the Phone.

ThauEx commented 8 years ago

Why do you want to do this? The Cert server is on :5051 and you have to set this port in proxy settings. But you should not open this url in the browser.

RhaoG commented 8 years ago

Thanks! Misread the 5050 from the 5051. Proxy works great! Thanks again!