Page 1 of 1

SB as client, PB as server, possible?

Posted: Tue Feb 20, 2018 12:28 am
by T4r4ntul4
Hi all,

Is it somehow possible to make SB as a client, and PB as a server?
If the answer is yes, what do i need to make it connect to each other?

Thoughts and or snippets are very appreciated!

Re: SB as client, PB as server, possible?

Posted: Tue Feb 20, 2018 12:43 am
by plouf
There is a demo http server in PB examples, isnt this enough ?

since every comand that SB can send back with httrequest and PB server will receive it !

Re: SB as client, PB as server, possible?

Posted: Tue Feb 20, 2018 8:16 am
by Peter
T4r4ntul4 wrote:Is it somehow possible to make SB as a client, and PB as a server?
you can take a look at SpiderBite: https://github.com/spiderbytes/SpiderBite

(the description is in german, but you can use DeepL)

Greetings ... Peter

Re: SB as client, PB as server, possible?

Posted: Tue Feb 20, 2018 11:29 am
by T4r4ntul4
What i want to do, i want to use it as a game server, the SB client is the game, and PB will be the server. Is this, httrequest or spiderbytes fast enough for that? (Meaning: realtime movement between all clients, sending data to PB server and back to clients)

Re: SB as client, PB as server, possible?

Posted: Tue Feb 20, 2018 11:54 am
by Peter
Than you can take a look at this topic using WebSocket-Communication:

http://forums.spiderbasic.com/viewtopic ... 362&p=4790

Greetings ... Peter

Re: SB as client, PB as server, possible?

Posted: Tue Feb 20, 2018 1:00 pm
by T4r4ntul4
Thank you for the link Peter, it works perfectly!

Re: SB as client, PB as server, possible?

Posted: Fri Feb 23, 2018 11:58 pm
by T4r4ntul4
I have a question related to this:

I wanted to use the SB client on my website to make a connection on my PC where the server is.
Only iam struggling to get it working properly.

What i have done so far:

in SB:
- changed the "ws://127.0.0.1:8090" to my own ip and port number: 27015

in PB:
- changed the: '*Server = WebSocket_Server::Create(27015, @WebSocket_Event())' ; this was port 8090

the rest:
- in my router i added a port forward to my internal ip and port with UDP and TCP port 27015
- on my computer i added in the firewall the same UDP and TCP ip and port 27015
- if i check on: https://www.yougetsignal.com/tools/open-ports/ on port 27015 the PB server says '#### client disconnected' so the portforward is good, otherwise i wont have that message anyway.
- if i test the same SB client with my outside ip and port, on my local PC, i can connect to my SB server which is on the same pc. that works.

Now comes the questions:
- did i miss something with firewall/ip/?
- can this work as i trying to do? (from website to pc?)

I use windows 10. and i use the code from Dirk Geppert, post: http://forums.spiderbasic.com/viewtopic ... 362&p=4790

Can someone shed some light on this? Your help is very much appreciated!

Re: SB as client, PB as server, possible?

Posted: Sat Feb 24, 2018 10:59 am
by T4r4ntul4
Turns out, my webhost doesnt support node.js / a second open port on the same website. :(

Re: SB as client, PB as server, possible?

Posted: Sun Feb 25, 2018 7:34 am
by T4r4ntul4
Sorry for the 'spam'. But a new message its on his place here for future reference.

Since all browser support websockets, websocket should work just out of the box. turns out my browser firefox blocks websocket (because i have https:// (ssl)), you can turn this on with:
i quote stackoverflow:
... https:// to ws:// is disallowed by default on firefox.

Going to firefox's about:config and toggling network.websocket.allowInsecureFromHTTPS will get rid of the SecurityError.
that solved it for me, so now you can just use Dirk his websocket code from your browser to PB server !!