Proxy detection?

Submit all your BlueBox related questions or report a bug here!

Moderators: Lapo, Bax

sennin31
Posts: 10
Joined: 26 Jul 2011, 05:33

Proxy detection?

Postby sennin31 » 31 Jan 2012, 17:02

Hi!

I don't really understand how blue box is able to detect if proxy is configured and detect is ip adress and port....

In fact, I'v got a proxy enabled on my network (who is not a transparent proxy), but, when blue box is trying to connect, it send is request directly to the server online, without sending the request to the proxy...why? How can I give to blue box my proxy configuration?

Thanks,
Sennin
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 01 Feb 2012, 08:59

The BlueBox exists to skip proxies, not use them.
Paolo Bax
The SmartFoxServer Team
sennin31
Posts: 10
Joined: 26 Jul 2011, 05:33

Postby sennin31 » 01 Feb 2012, 09:30

Hum, okay, I'm a little confused now....

If bluebox is made for skipping proxies, what should I do to skip a non transparent proxy?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 01 Feb 2012, 09:53

There is a misunderstanding. At the level of the Flash Player plugin there is no "knowledge" of what is connecting you to the network. In fact this is a task that is performed at the OS level, not even in the browser.

If you are using a proxy it is very likely that your browser is configure to connect to the proxy which in turn will provide the access to the internet. Again the Flash plugin knows nothing about this, he could care less :) Ok?

So you are behind a proxy and you have just loaded a web page containing a multiplayer game in Flash (or Unity). The game attempts a direct TCP socket connection but the proxy refuses it and you won't be able to play. End of story.
And here the BlueBox comes to rescue. It detects the failure and it attempts to communicate with the game server via HTML requests that wrap the socket communication. Actually the BlueBox does a whole lot more, but in essence this is how it works.

If the proxy is super-smart and analyzes the HTML packets it might prevent you to play anyways but if it is this smart it probably would not even allow you to reach the game website, so .... the problem wouldn't even exist :)

Most proxies, however, can be fooled using this technique which is called "HTTP-Tunnelling".

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
sennin31
Posts: 10
Joined: 26 Jul 2011, 05:33

Postby sennin31 » 01 Feb 2012, 10:40

Hi Lapo,

For information, I'm not using flash, but Unity. More, I'm not building a Web Player, but a standalone (I give up web players, beacause I was'nt able to get blue box working to).

Here is the story of my tests :

I launch my standalone, who is under a proxy.
I try to connect to my SFS pro, who is on another network.
The connection failed, the connection switch to bluebox.
The connection failed to, I got a time out.

Here is my code for the connection :

Code: Select all

void Awake() {

      if( ! SmartFox.IsInitialized() ) {
         try {
            AddSfsEvent();
            smartFox = SmartFox.Connection = new SmartFoxClient(debug);
            smartFox.smartConnect = true;
            smartFox.httpPort = blueboxport;
            smartFox.Connect(ip, port);
         }
         catch (Exception e) {
            errorMessage = e.ToString();
            print( errorMessage);
         }
      }
   }


When I read my proxy log file, there is nothing, when I use Wireshark, I saw that the connection packet is send directly to my SFS server, but it's not responding.

Am I doing something wrong?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 01 Feb 2012, 11:27

Again it is the same problem. Does the network abstraction in Unity provide settings for a proxy server?
I wouldn't expect it, but maybe I am wrong.

Or... let's take it from another point of view. Suppose in your Unity app you need to access some resources on your website (e.g. an update). How do you configure the connection so that it uses a local proxy?

I will invite Thomas Lund to this discussion too, he's the our Unity guru :)
Lapo

--

gotoAndPlay()

...addicted to flash games
sennin31
Posts: 10
Joined: 26 Jul 2011, 05:33

Postby sennin31 » 01 Feb 2012, 12:53

This sound more clear for me.

This is how I configure the connection to get some web content (XML for example)

Code: Select all

myRequest = (HttpWebRequest)WebRequest.Create("http://www.myurl.com");
      
      Proxy = new WebProxy();
      Uri newUri=new Uri(proxyadress);
      Proxy.Address=newUri;
      
      myRequest.Proxy=Proxy;
      print("Proxy by passed : " + Proxy.IsBypassed(new Uri(proxyadress)));

      myResponse = myRequest.GetResponse();


Here we can see that I've got to use a native C# class to set the proxy adress. I don't think that the network abstraction in unity provide settings for a proxy server, or I haven't see this information somewhere...

Return to “BlueBox”

Who is online

Users browsing this forum: No registered users and 19 guests