-
• #2
This works:
var http = require("http"); http.createServer(function (req, res) { res.writeHead(200); res.end("Hello World"); }).listen(8080);
I have checked telnet is not running - well it doesn't answer on :
telnet 192.168.69.12 Connecting To 192.168.69.12...Could not open connection to the host, on port 23: Connect failed
-
• #4
Thanks for replying
-
• #5
telnet syntax
telnet [host [port]]
-
• #6
hmm. nobody home with:
telnet 192.168.69.12 2323 Connecting To 192.168.69.12...Could not open connection to the host, on ort 2323: Connect failed
or adding to the web ide..
Also, is this a concern - and what is the cause?
WARNING: jsnative.c sanity check failed (int-float-int passing)
-
• #7
@Wilberforce come to https://gitter.im/espruino/Espruino to gitter
-
• #8
Thanks to @MaBe, it turns out the Makefile had the telnet off by default, need to do a pull request and update!
BOARD=LINUX
LINUX=1
USE_FILESYSTEM=1
USE_HASHLIB=1
USE_GRAPHICS=1
USE_CRYPTO=1
USE_TLS=1
#USE_TELNET=1 # enable telnet to have it listen on port 2323 as JS console
#USE_LCD_SDL=1USE_TELNET=1 # enable telnet to have it listen on port 2323 as JS console
-
• #9
WARNING: jsnative.c sanity check failed (int-float-int passing)
root@esp8266-VirtualBox:/home/esp8266/Espruino/Espruino# uname -a
Linux esp8266-VirtualBox 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:18:00 UTC 2015 i686 i686 i686 GNU/Linux`
root@esp8266-VirtualBox:/home/esp8266/Espruino/Espruino# gcc -v
Using built-in specs.
COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrapper Target: i686-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu Thread model: posix gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)
Ok on this system:
root@nodejs ~/Espruino# uname -a Linux nodejs 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u3 x86_64 GNU/Linux
root@nodejs ~/Espruino# gcc -v
Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.7.2 (Debian 4.7.2-5)
So I'm wondering if it a gcc version thing?
-
• #10
Ahh, thanks for letting me know. I guess I'm not 100% sure if it should be on by default then, since it's a massive security hole if anyone is currently using Espruino and isn't expecting a port to be opened.
You can always do
USE_TELNET=1 make
- although that should be documented. Ideally it would be a command-line option.For
int-float-int passing
- that's interesting. It's referring to what happens if you call a function that takes those 3 arguments. It could be an issue with 32 bit x86 - I checked here and it happens on a real system too.It's not a huge deal since it's actually pretty rare that particular argument format is used - I doubt you'd notice a problem. If you do come across it, you'll notice that some of the arguments get corrupted, but it won't cause a crash or anything.
When you post stuff like that up in future, please can you try and surround it in the 3 backticks? As it is, it's a real pain to look through and see what's text you've written and what's command output.
-
• #11
I did try to use back ticks, but it went bung, so I removed them!
I thought I would add now on the iPad, however the character isn't on the keyboard!
For the Linux build is there any other way of loading code via the ide, if there isn't - that's why I was expecting it to be on by default. Can it be called a security hole if it's not on a default port?
As you say documenting makes all the difference!
I updated the gcc compiler on the 32 bit system - it made no difference
-
• #12
I did try to use back ticks
You probably need an empty line before and after - markdown is a pain like that!
For the Linux build is there any other way of loading code via the ide,
Kind of. You can set Linux up such that Espruino auto-runs and is accessible using a telnet server - There was a post on the forum about it. @tve only added the internal server relatively recently.
Can it be called a security hole if it's not on a default port?
I imagine so, yes. If I could port-scan your PC and then access it remotely with no password, I think that's something you'd want to fix :)
IMO the command-line option would be the way to go, and it can be documented in
--help
and also theTelnet
docs I linked in my first post -
• #13
IMO the command-line option would be the way to go
Agreed
and also the Telnet docs I linked in my first post
http://www.espruino.com/Reference#Telnet
I guess it's making the association that the Telnet server implementation is what the web IDE is using, perhaps that could be spelt out. -
• #14
I wanted to use the telnet service on linux to run some tests (I think it was to make sure that the service wasn't tied to anything specific in the esp8266), so I made the changes necessary to be able to enable it, but I didn't want to open up the port in general given the security issues.
I've built using these instructions in a linux VM:
http://forum.espruino.com/comments/5764/
The exe spins up:
How do I connect with the Web ide?
I tried adding the IP of the VM under communications > Connect over Ip Address, however the instance is not found.
Do you need to set up a virtual com port, or can connect via IP to a Linux instance.
I'm hoping the VM version will be a lot more snappy for development - especially uploading when developing modules!