This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
oeed's profile picture

How to enable the HTTP API

Started by oeed, 16 March 2014 - 09:39 AM
oeed #1
Posted 16 March 2014 - 10:39 AM
This tutorial does not apply to ComputerCraft 1.63. Read this post as to how to fix it on there.

I soon intend to release OneOS on the FTB, Tekkit, etc forums and as the only way to install it is via HTTP I tried to find a tutorial that explains how to enable it. However, the only things I found were single posts that very briefly said to open the cfg file, so I've decided to make a tutorial on it for both Windows and Mac as well as client and servers.

To find the apporopirate tutorial, open the Windows or Mac spoiler then open either the client or server spoiler within.

If you want to enable HTTP on a server that you don't run you'll have to talk to an admin, giving them the link to this page.

Mac
Client (single player)First, and most obvious, make sure that you have both Minecraft and ComputerCraft installed on your Mac. It'll be pretty hard to enable HTTP without them!

Make sure you close Minecraft before continuing.

Switch to Finder, than open the 'Go' menu and click on 'Go to Folder…', as shown in the screenshot.


In the window that appears, or slides down, enter in the following and click 'Go' as depicted below.


You should now see various files and folders. Open the 'config' folder and select 'ComputerCraft.cfg'


Right click 'ComputerCraft.cfg' then click on 'Open with' > 'Other…'


Select TextEdit (or any other text editor, but NOT Word or Pages) and click 'Open'


Scroll down a little and find 'B:enableAPI_http=' then select 'false' at the end of the line.


Type in 'true', the file should now look like this:


Then simply save and close the file then open Minecraft.

If you have any problems leave a message below.
Server (for server owners)It's probably best to stop the server whilst doing this, but it's not completly necassary. You will, however, need to restart your server before the changes are applied.

Open the server folder (containing the minecraft_server.jar) in Finder. You should now see various files and folders. Open the 'config' folder and select 'ComputerCraft.cfg'


Right click 'ComputerCraft.cfg' then click on 'Open with' > 'Other…'


Select TextEdit (or any other text editor, but NOT Word or Pages) and click 'Open'


Scroll down a little and find 'B:enableAPI_http=' then select 'false' at the end of the line.


Type in 'true', the file should now look like this:


Then simply save and close the file then turn on/restart your server.

If you have any problems leave a message below.

Windows
Client (single player)I'm using Windows 8.1, but everything should be identical, however, if you're still using Windows XP (which, I might add, is older than many people who use these forums) you'll need to replace '/Users/…' with '/Documents and Settings/…'

First, and most obvious, make sure that you have both Minecraft and ComputerCraft installed on your PC. It'll be pretty hard to enable HTTP without them!

Make sure you close Minecraft before continuing.

Press Windows + R to open the Run window. Enter the following in to the text box then click 'OK': %APPDATA%/.minecraft/


You should now see various files and folders. Open the 'config' folder and right click 'ComputerCraft.cfg'. If you have a program that will automatically open the file use it, other wise click 'Open with' and select Notepad


Scroll down a little and find 'B:enableAPI_http=' then select 'false' at the end of the line then type in 'true', ensuring false is completly removed.


Then simply save and close the file then open Minecraft.

If you have any problems leave a message below.
Server (for server owners)I'm using Windows 8.1, but everything should be identical, however, if you're still using Windows XP (which, I might add, is older than many people who use these forums) you'll need to replace '/Users/…' with '/Documents and Settings/…'

It's probably best to stop the server whilst doing this, but it's not completly necassary. You will, however, need to restart your server before the changes are applied.

Open the server folder (containing the minecraft_server.jar). You should now see various files and folders. Open the 'config' folder and right click 'ComputerCraft.cfg'. If you have a program that will automatically open the file use it, other wise click 'Open with' and select Notepad


Scroll down a little and find 'B:enableAPI_http=' then select 'false' at the end of the line then type in 'true', ensuring false is completly removed.


Then simply save and close the file then turn on/restart your server.

If you have any problems leave a message below.

If you're on Linux, I'm sure you can figure out how to get it working as you're able to use Linux, use the guides above as a rough guide.
Edited on 04 July 2014 - 04:22 AM
CometWolf #2
Posted 16 March 2014 - 10:46 AM
I soon intend to release OneOS to on the FTP
That cracked me up more than it should have, even though i knew what you were supposed to write.

http is enabled by default i believe, meaning if it's disabled, whoever did it should know how to turn it back on :P/>
oeed #3
Posted 16 March 2014 - 10:53 AM
I soon intend to release OneOS to on the FTP
That cracked me up more than it should have, even though i knew what you were supposed to write.

http is enabled by default i believe, meaning if it's disabled, whoever did it should know how to turn it back on :P/>

Damn it! Typo fixed.
In vanilla CC isn't not on by default, as of 1.58 at least. Some mod packs will have it on though.
adencraft2000 #4
Posted 17 March 2014 - 09:12 PM
Spoiler

Question, On the mac examples I saw one of the ".DS_Store" files, These (as you may know) are hidden files and not normally visible without some trickery. What trickery did you use to make it show hidden thingies?
Edited on 17 March 2014 - 08:13 PM
oeed #5
Posted 17 March 2014 - 09:19 PM
Spoiler

Question, On the mac examples I saw one of the ".DS_Store" files, These (as you may know) are hidden files and not normally visible without some trickery. What trickery did you use to make it show hidden thingies?

Simply Googled it.
http://ianlunn.co.uk/articles/quickly-showhide-hidden-files-mac-os-x-mavericks/
awsmazinggenius #6
Posted 18 March 2014 - 05:59 AM
Nice tutorial, but if you plan on releasing it to the FTB or Tekkit launchers you should point them to the appropriate directories (make more sections). Also, I know that at least in some FTB packs HTTP comes enabled already. Tell them to type "http" in their Lua prompt to check if the table exists. Also, I find it weird how in the Windows tutorial the windows have different colors for the window border throughout the tutorial
oeed #7
Posted 18 March 2014 - 07:21 AM
Nice tutorial, but if you plan on releasing it to the FTB or Tekkit launchers you should point them to the appropriate directories (make more sections). Also, I know that at least in some FTB packs HTTP comes enabled already. Tell them to type "http" in their Lua prompt to check if the table exists. Also, I find it weird how in the Windows tutorial the windows have different colors for the window border throughout the tutorial
I forgot about the paths… hmm. I'll need to work on that.
HTTP checking is a good idea.
The Windows border changes because my desktop changes and the border colour is based off the desktop.
TheOddByte #8
Posted 18 March 2014 - 10:37 AM
It would be easier for them to go into the lua prompt and type this to check if HTTP is enabled

if http then print("HTTP is enabled") else print("HTTP is disabled!") end
And it seems that this tutorial is aimed at vanilla minecraft right? Since it seems in FTB and Technic HTTP is enabled by default and in vanilla MC it's not.
CometWolf #9
Posted 18 March 2014 - 10:41 AM
What awsmazing suggested is easier. If it returns nil, it's disabled.
Tell them to type "http" in their Lua prompt to check if the table exists.

Why is http off by default anyways?
Edited on 18 March 2014 - 09:44 AM
oeed #10
Posted 18 March 2014 - 10:48 AM
It would be easier for them to go into the lua prompt and type this to check if HTTP is enabled

if http then print("HTTP is enabled") else print("HTTP is disabled!") end
And it seems that this tutorial is aimed at vanilla minecraft right? Since it seems in FTB and Technic HTTP is enabled by default and in vanilla MC it's not.
Easier? You mad?

What awsmazing suggested is easier. If it returns nil, it's disabled.
Tell them to type "http" in their Lua prompt to check if the table exists.

Why is http off by default anyways?
I question that too. My one guess is that it's due to security.
TheOddByte #11
Posted 18 March 2014 - 10:50 AM
What awsmazing suggested is easier. If it returns nil, it's disabled.
Tell them to type "http" in their Lua prompt to check if the table exists.

Why is http off by default anyways?
I have no clue, That's a question Dan himself would have to answer.
But I doubt he will here since he doesn't even reply to PMs :P/>
awsmazinggenius #12
Posted 19 March 2014 - 05:36 AM
oeed: I figured that, but what I'm saying is keep it the same throughout the tutorial (just set it to be one color temporarily.)
oeed #13
Posted 19 March 2014 - 05:50 AM
oeed: I figured that, but what I'm saying is keep it the same throughout the tutorial (just set it to be one color temporarily.)
It wasn't really anything I thought about to be honest. I'll redo them if I find the time.
awsmazinggenius #14
Posted 19 March 2014 - 05:07 PM
typo:
I soon intend to release OneOS to on the FTB, Tekkit, etc forums

should be either "on" or "in to".
MostwantedRBX #15
Posted 19 March 2014 - 07:48 PM
Lol, why are you guys messing with his typing. :P/> He does better then half the people on the internet. Anyways, this is a good tutorial for those who don't know how to edit config files or people who didn't even know they existed. Good job.
awsmazinggenius #16
Posted 20 March 2014 - 04:05 AM
Lol, why are you guys messing with his typing. :P/>/> He does better then half the people on the internet. Anyways, this is a good tutorial for those who don't know how to edit config files or people who didn't even know they existed. Good job.

Because if you are writing a tutorial, you might as well make it easy to read then "to go the confine and chang it to true lol".
BytePointer #17
Posted 19 June 2014 - 06:48 AM
It's a nice tutorial! I'm sure you helped some of the newbies whose HTTPApi 'magically' switched off ;)/>
Tobias SN #18
Posted 09 March 2016 - 08:26 AM
Lol, why are you guys messing with his typing. :P/>/> He does better then half the people on the internet. Anyways, this is a good tutorial for those who don't know how to edit config files or people who didn't even know they existed. Good job.

Because if you are writing a tutorial, you might as well make it easy to read then "to go the confine and chang it to true lol".

You might also consider it while writing a supposed-to-be-constuctive reply ("you might as well make it easy to read than "To go the config and change it to true lol"")