Jump to content

EnderCC: Easy HTTP networking

11 replies to this topic

#1 Sxw

  • Members
  • 306 posts
  • LocationWhenever, Wherever!

Posted 13 July 2014 - 10:15 PM

EnderCC is a HTTP framework. It's easy to use and you don't have to setup your own server!

pastebin get V91n5SXC ender

Usage in a lua prompt:
On one computer:
-- Send message on other computer
On the other:
ender.send("testchannel", "Hello!"))
ender.getName("testchannel") -- The computers name that appears to other clients

Edited by Sxw, 17 March 2015 - 05:15 PM.

#2 Kizz

  • Members
  • 99 posts
  • LocationLouisville, Kentucky

Posted 14 July 2014 - 06:09 PM

Isn't this basically the modem API?

#3 flaghacker

  • Members
  • 655 posts

Posted 14 July 2014 - 08:51 PM

It's meant to be like the modem API, but it is via http, vis an external server. It has infinite range and works between dimensions and even servers. (at least that's what I think)

Edited by flaghacker, 14 July 2014 - 08:53 PM.

#4 Kizz

  • Members
  • 99 posts
  • LocationLouisville, Kentucky

Posted 15 July 2014 - 01:53 PM

Ow nice! Yea, I kinda missed the HTTP part. Lack of sleep is getting to me!

#5 Sxw

  • Members
  • 306 posts
  • LocationWhenever, Wherever!

Posted 16 July 2014 - 12:22 AM

Yes, it's designed for cross world and server communication.

#6 biggest yikes

  • Members
  • 573 posts

Posted 18 July 2014 - 12:31 AM

So is this your way of making that email between servers you mentioned on irresponsiblecraft?

#7 bigbrainiac10

  • Members
  • 41 posts

Posted 23 July 2014 - 07:56 AM

Whenever I try to use this API, I always get an error on line 113.

I'm trying to use the examples provided.

#8 Sxw

  • Members
  • 306 posts
  • LocationWhenever, Wherever!

Posted 28 July 2014 - 11:10 PM

That's odd. What is the error? Line 113 is just an http.get. Do you have HTTP enabled?

#9 bigbrainiac10

  • Members
  • 41 posts

Posted 29 July 2014 - 02:37 AM

I have HTTP enabled. I believe the error I receive is a "index nil value" error

#10 Sxw

  • Members
  • 306 posts
  • LocationWhenever, Wherever!

Posted 08 August 2014 - 04:01 PM

Are you sure you have http on? Try typing http.get("http://fluidnode.com/ping") into a lua console.
If that works, are you using the latest version?

#11 ardera

  • Members
  • 503 posts
  • LocationGermany

Posted 31 August 2014 - 03:48 PM

It seems you need to pass an argument to ender.receive, otherwise ender.connect (which is called by ender.receive) searches for nil in the connected channels list, which isn't there, so it calls rawStart to connect to 'nil'. rawStart calls http.get with a string concatenated with the channel which is nil, and baam, "attempt to concatenate string and nil"

Then, line 179,
chans[channel] --# needs to be:

Sending doesn't work serverside, if I try to send "hey" in a browser, it errors:
TypeError: Object #<Object> has no method 'forEach'
   at /var/lib/openshift/53a07cf1500446c6e3000183/app-root/runtime/repo/app/views/EnderCC.js:32:12
   at Layer.handle [as handle_request] (/var/lib/openshift/53a07cf1500446c6e3000183/app-root/runtime/repo/node_modules/express/lib/router/layer.js:76:5)
   at next (/var/lib/openshift/53a07cf1500446c6e3000183/app-root/runtime/repo/node_modules/express/lib/router/route.js:100:13)
   at Route.dispatch (/var/lib/openshift/53a07cf1500446c6e3000183/app-root/runtime/repo/node_modules/express/lib/router/route.js:81:3)
   at Layer.handle [as handle_request] (/var/lib/openshift/53a07cf1500446c6e3000183/app-root/runtime/repo/node_modules/express/lib/router/layer.js:76:5)
   at /var/lib/openshift/53a07cf1500446c6e3000183/app-root/runtime/repo/node_modules/express/lib/router/index.js:227:24
   at Function.proto.process_params (/var/lib/openshift/53a07cf1500446c6e3000183/app-root/runtime/repo/node_modules/express/lib/router/index.js:305:12)
   at /var/lib/openshift/53a07cf1500446c6e3000183/app-root/runtime/repo/node_modules/express/lib/router/index.js:221:12
   at Function.match_layer (/var/lib/openshift/53a07cf1500446c6e3000183/app-root/runtime/repo/node_modules/express/lib/router/index.js:288:3)
   at next (/var/lib/openshift/53a07cf1500446c6e3000183/app-root/runtime/repo/node_modules/express/lib/router/index.js:182:10)

I love the idea, and I'd love to see this in action :)

Edited by ardera, 31 August 2014 - 03:51 PM.

#12 Hydrotronics

  • Members
  • 131 posts
  • LocationThe hall of 1000 monkeys and only 1 typewriter

Posted 17 August 2016 - 04:37 PM

How do I use the API to send strings? I'm currently trying to make a cross server chat for my OS (you will be credited) and when I tried pasting the message on the screen of the receiving end, it came up with "truetest" and then a bunch of characters and numbers. It looks as though it's been encrypted :P how do I convert it back?

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users