Hello SmartFoxTeam,
i wanted to know while using blue box for client communications when does the WebSocket gets created or it doesn't ?
BlueBox and Websocket Connection
-
- Posts: 6
- Joined: 09 Apr 2021, 12:27
Re: BlueBox and Websocket Connection
Hi,
the BlueBox is used as a backup connection system if a normal TCP connection is not possible for the client. For example because the client is behind a proxy or firewall blocking most uncommon traffic.
The BlueBox tunnels the connection via HTTP thus allowing most clients to be able to connect, as firewalls and proxies typically allow HTTP traffic. Also the BlueBox does not use Websocket, but rather an optimized HTTP polling system.
You can read more here:
http://docs2x.smartfoxserver.com/GettingStarted/bluebox
Cheers
the BlueBox is used as a backup connection system if a normal TCP connection is not possible for the client. For example because the client is behind a proxy or firewall blocking most uncommon traffic.
The BlueBox tunnels the connection via HTTP thus allowing most clients to be able to connect, as firewalls and proxies typically allow HTTP traffic. Also the BlueBox does not use Websocket, but rather an optimized HTTP polling system.
You can read more here:
http://docs2x.smartfoxserver.com/GettingStarted/bluebox
Cheers
-
- Posts: 6
- Joined: 09 Apr 2021, 12:27
Re: BlueBox and Websocket Connection
Thanks, But our requirement is as follows ::
We don't want the WebSocket(9933) to be connected at first and want to add a custom filter to different requests on server side ,Is there a way of doing this ? We want to do this in case of DOS attacks.
We don't want the WebSocket(9933) to be connected at first and want to add a custom filter to different requests on server side ,Is there a way of doing this ? We want to do this in case of DOS attacks.
Re: BlueBox and Websocket Connection
Let me clarify one aspect:
Websocket is not port 9933.
SmartFoxServer uses port TCP/UDP port 9933 for socket connections using the SFS2X protocol.
You can alternatively use the HTTP Websocket protocol (on port 8080 or 8443) for HTML5 or Unity WebGL clients.
With this said, sorry but I don't understand your question. I have no idea what kind of filters you're referring to.
Can you please explain what kind of client API you're using and what is your use case?
Thanks
Websocket is not port 9933.
SmartFoxServer uses port TCP/UDP port 9933 for socket connections using the SFS2X protocol.
You can alternatively use the HTTP Websocket protocol (on port 8080 or 8443) for HTML5 or Unity WebGL clients.
With this said, sorry but I don't understand your question. I have no idea what kind of filters you're referring to.
Can you please explain what kind of client API you're using and what is your use case?
Thanks
-
- Posts: 6
- Joined: 09 Apr 2021, 12:27
Re: BlueBox and Websocket Connection
Hello Lapo,
We want to put a custom API gateway on the server-side using JS API on the client-side on `first connection` using either the port 8080 or 8443. Whenever the first request comes from the web client(JS), we want the SFS to have a custom API filter to that request. Is there a way to achieve this?
We want to put a custom API gateway on the server-side using JS API on the client-side on `first connection` using either the port 8080 or 8443. Whenever the first request comes from the web client(JS), we want the SFS to have a custom API filter to that request. Is there a way to achieve this?
Re: BlueBox and Websocket Connection
Hi,
maybe there's a bit of confusion on my part because of the terminology you are using.
Let me try to explain a bit how SmartFoxServer works. When a client opens a connection it is simply making an initial handshake to make sure that communication is possible. After the connection is done (which is notified by a client-side SFSEvent.CONNECTION event) the user is still not able to do much with the server.
In fact at this point the client can only send a valid LoginRequest, requiring to join on of the available Zones in the server. Each Zone represents a different application that is running in SFS2X.
If you want you can handle the LoginRequest on the server side with your own custom code, which I think is what you're referring to as "filter" in your previous post.
If that's the case you can read how this is done here:
https://smartfoxserver.com/blog/how-to- ... tom-login/
And if you're new to creating server side Extensions you should start from here:
http://docs2x.smartfoxserver.com/Extens ... uick-start
Cheers
maybe there's a bit of confusion on my part because of the terminology you are using.
Let me try to explain a bit how SmartFoxServer works. When a client opens a connection it is simply making an initial handshake to make sure that communication is possible. After the connection is done (which is notified by a client-side SFSEvent.CONNECTION event) the user is still not able to do much with the server.
In fact at this point the client can only send a valid LoginRequest, requiring to join on of the available Zones in the server. Each Zone represents a different application that is running in SFS2X.
If you want you can handle the LoginRequest on the server side with your own custom code, which I think is what you're referring to as "filter" in your previous post.
If that's the case you can read how this is done here:
https://smartfoxserver.com/blog/how-to- ... tom-login/
And if you're new to creating server side Extensions you should start from here:
http://docs2x.smartfoxserver.com/Extens ... uick-start
Cheers
-
- Posts: 6
- Joined: 09 Apr 2021, 12:27
Re: BlueBox and Websocket Connection
Hello Lapo,
Thank you for your help, but we are still having some questions like
a) Can we use the Anti-flood filter on the `LoginRequest`? or
b) Use ISystemFilterChain `SystemRequest.Login` at the Zone extension ?
Thanks,
Shashank
Thank you for your help, but we are still having some questions like
a) Can we use the Anti-flood filter on the `LoginRequest`? or
b) Use ISystemFilterChain `SystemRequest.Login` at the Zone extension ?
Thanks,
Shashank
Re: BlueBox and Websocket Connection
Hi,
no, there's no direct way to apply a Flood Filter to the Login request, but you can track those requests in your server side code.
No need to use a FilterChain. Just a normal Extension.
When a Session sends a LoginRequest you can store the current timestamp (System.currentTimeMillis) as a property of the Session itself and proceed by validating the request. If another request (from the same Session) is received later you can compare it with the previous timestamp and decide to drop it or not.
The methods I am referring to are Session.getProperty() and Session.setProperty()
Hope it helps
no, there's no direct way to apply a Flood Filter to the Login request, but you can track those requests in your server side code.
No need to use a FilterChain. Just a normal Extension.
When a Session sends a LoginRequest you can store the current timestamp (System.currentTimeMillis) as a property of the Session itself and proceed by validating the request. If another request (from the same Session) is received later you can compare it with the previous timestamp and decide to drop it or not.
The methods I am referring to are Session.getProperty() and Session.setProperty()
Hope it helps
Who is online
Users browsing this forum: No registered users and 103 guests