Jump to content




Zombienet - Http, Cross Server Communication!


16 replies to this topic

#1 Sxw

  • Members
  • 306 posts
  • LocationWhenever, Wherever!

Posted 04 October 2013 - 05:54 PM

Zombienet is a framework to let you communicate over http, cross server.

Usage:
Spoiler

Notes:
Spoiler

Download:
pastebin.com/xqdNSNwY
pastebin get xqdNSNwY zn

Edited by Sxw, 15 December 2013 - 04:26 PM.


#2 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 04 October 2013 - 06:07 PM

i have to say this, but Zombienet was actually developed before httpnet
so no flamewars about stealing .-.

#3 MudkipTheEpic

  • Members
  • 639 posts
  • LocationWhere you'd least expect it.

Posted 04 October 2013 - 06:33 PM

Telling programmers "don't mess with my server" is equivalent to telling a thief "don't touch my stuff".



#4 Yevano

  • Members
  • 376 posts
  • LocationUSA

Posted 04 October 2013 - 06:58 PM

 MudkipTheEpic, on 04 October 2013 - 06:33 PM, said:

Telling programmers "don't mess with my server" is equivalent to telling a thief "don't touch my stuff".

Yes, you can always use the "For science!" excuse.

#5 Zudo

  • Members
  • 800 posts
  • LocationUK

Posted 04 October 2013 - 11:18 PM

I like the idea of queuing an event when a message is received.

#6 alakazard12

  • Banned
  • 93 posts

Posted 20 October 2013 - 07:38 AM

I tried doing something like this 6 months ago, but I couldn't get it to work with 000webhost because it was sending too many messages to the site, and 000webhost blocks that .-.

#7 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 20 October 2013 - 03:02 PM

 alakazard12, on 20 October 2013 - 07:38 AM, said:

I tried doing something like this 6 months ago, but I couldn't get it to work with 000webhost because it was sending too many messages to the site, and 000webhost blocks that .-.
its verry hard to do in php
well properly that is, the proper way is to only serve the request only when its needed (long polling)
the way php was designed makes this hard to do without being slow, taking up unnecicary threads, etc
this can be done in node.js pretty easialy though, but i prefer luvit because it is lua
though i would like plugins have access to libraries like sqlite, thats why i use normal lua

#8 skwerlman

  • Members
  • 163 posts
  • LocationPennsylvania

Posted 02 December 2013 - 07:09 PM

This looks great! I'd definitely like to have it running on my server! Any chance you could post those instructions?

#9 Sxw

  • Members
  • 306 posts
  • LocationWhenever, Wherever!

Posted 14 December 2013 - 12:18 PM

Well, the current code is kinda messy, but you could make your own server. The protocol is very simple. But the main point of this is cross server communication, so it might be better to just use my server. For reference:
Spoiler


#10 gknova61

  • Members
  • 74 posts

Posted 14 December 2013 - 07:30 PM

Could we get a tutorial and/or the scripts you're using server-side? The website directory? I just want to see how the current code works messy or not and host it on my server so it's more reliable for me.

Edit: When I try to use the API to just get a key, it errors with cannot connect to the server, too.

Edited by gknova61, 14 December 2013 - 07:37 PM.


#11 ardera

  • Members
  • 503 posts
  • LocationGermany

Posted 15 December 2013 - 08:01 AM

it's because he's missing an / in the serv variable.

It tries to connect to "http://zn.fluidnode.comobtain" instead of "http://zn.fluidnode.com/obtain".


EDIT:

 Sxw, on 14 December 2013 - 12:18 PM, said:

zn.fluidnode.com/send
Sends a message to session id's channel.
Does that mean I'm sending messages to a session ID, instead of sending them to a channel?
I thought it works like rednet, multiple computers can join a channel and they only receive messages from this channel.

What is a session ID then?

Edited by ardera, 15 December 2013 - 09:48 AM.


#12 Sxw

  • Members
  • 306 posts
  • LocationWhenever, Wherever!

Posted 15 December 2013 - 04:24 PM

I fixed the code on pastebin. Not missing a / anymore. Lemme post the code.
Server in node.js(uses private base library): http://pastebin.com/9sV3ws4i
A session id is basicly an inbox.
Also updated tutorial to be more clear.

Edited by Sxw, 15 December 2013 - 04:26 PM.


#13 ardera

  • Members
  • 503 posts
  • LocationGermany

Posted 16 December 2013 - 08:51 AM

Polling / Sending still doesn't work, "Unable to connect to server". Also, calling the poll/send URL's in browser works.

It seems like CC interprets 4xx status codes as a http_failure, you should set the status codes to 200 instead of 4xx in your Server, then I'm sure it'll work.

#14 Sxw

  • Members
  • 306 posts
  • LocationWhenever, Wherever!

Posted 17 December 2013 - 05:25 PM

I hate http. xD. Should be fixed soon.

#15 ardera

  • Members
  • 503 posts
  • LocationGermany

Posted 18 December 2013 - 02:48 PM

still doesn't work for me, "query invalid" :P

Got it working using this function instead of http.post in "aObtain" (not needed there), "aPoll" and "aSend":
Spoiler

Edited by ardera, 18 December 2013 - 02:49 PM.


#16 Sxw

  • Members
  • 306 posts
  • LocationWhenever, Wherever!

Posted 19 December 2013 - 10:42 PM

This was a server-side issue where it wasn't parsing POST correctly. I didn't use GET for security reasons. I want to get an HTTPS cert for my domain but for now, oh well. All fixed now. No modified client is needed.

#17 ardera

  • Members
  • 503 posts
  • LocationGermany

Posted 21 December 2013 - 06:02 AM

Thanks, I think it works now :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users