Giter VIP home page Giter VIP logo

http-console's People

Contributors

chikamichi avatar cloudhead avatar eladb avatar eugenebolshakov avatar fivecommits avatar kindy61 avatar mscdex avatar ndrut avatar polotek avatar samsonjs avatar tj avatar wenbing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

http-console's Issues

JWT authentication

I see digest auth is supported.

It would be nice if Www-Authenticate: ... in response was detected and user/pass could be input.

A problem with POST and PUT

It looks like POST and PUT requests stopped working after readline support has been added. When I try to enter data it just echoes my input and doesn't perform the request:

$ http-console google.com
> http-console 0.3.0
> Welcome, enter \help if you're lost.
> Connecting to google.com on port 80.

http://google.com:80/> POST
... whatever
whatever

Changing dataPrompt to use readline seem to fix the issue:
eugenebolshakov/http-console@c263c7c989e83a1ff3c5cbd5852f16b32f435256

POST / PUT data in readme misleading

Browsing the code I was able to figure out that in order to send multiple datums for POST I had to use a syntax like

x=1&y=2

rather than something like

{"x":1,"y":2}

The latter would be cool, but seems to not be supported at the moment. The former is fine but the documentation should be changed to reflect it.

TypeError when using --cookies

When http-console tries to store a cookie, this happens:

TypeError: Object myCoolWebApp_session=4d03fceabee6760485000002; HttpOnly has no method 'split'
    at [object Object].rememberCookies (/usr/local/lib/node/.npm/http-console/0.5.1/package/lib/http-console.js:267:44)
    at ClientRequest.<anonymous> (/usr/local/lib/node/.npm/http-console/0.5.1/package/lib/http-console.js:115:54)
    at ClientRequest.emit (events.js:27:15)
    at HTTPParser.onIncoming (http.js:987:9)
    at HTTPParser.onHeadersComplete (http.js:88:31)
    at Client.onData [as ondata] (http.js:880:27)
    at Client._onReadable (net.js:566:27)
    at IOWatcher.onReadable [as callback] (net.js:151:10)

It looks like whatever is in the headers array here is not a proper string.

Error with connection; "Stream already opened"

Just started with it (npm installer), but got this error (also with source version from github):

[ arunjitsingh ] ~ ◊:  54$ http-console 127.0.0.1:5984
> http-console 0.5.1
> Welcome, enter \help if you're lost.
> Connecting to 127.0.0.1 on port 5984.

http://127.0.0.1:5984/> GET /
Error: Stream already opened
    at Client.connect (net.js:630:22)
    at Client._ensureConnection (http.js:1040:10)
    at Client.request (http.js:1055:8)
    at [object Object].request (/Users/arunjitsingh/.node_libraries/.npm/http-console/0.5.1/package/lib/http-console.js:110:31)
    at [object Object].exec (/Users/arunjitsingh/.node_libraries/.npm/http-console/0.5.1/package/lib/http-console.js:191:22)
    at Interface. (/Users/arunjitsingh/.node_libraries/.npm/http-console/0.5.1/package/lib/http-console.js:60:18)
    at Interface.emit (events.js:31:17)
    at Interface._onLine (readline.js:123:10)
    at Interface._ttyWrite (readline.js:335:12)
    at Interface.write (readline.js:173:30)
http://127.0.0.1:5984/> Error: assertion error
    at node.js:35:19
    at IOWatcher.onWritable [as callback] (net.js:164:18)
http://127.0.0.1:5984/> Error: assertion error

That last repeats in an endless loop..

(Using the bleeding-edge version of node: v0.3.4-pre)

Same thing happens with PUT, POST and DELETE requests

cURL'ing works:

[ arunjitsingh ] ~ ◊:  58$ curl http://127.0.0.1:5984
{"couchdb":"Welcome","version":"1.0.1"}

Thoughts/ideas?

Add Content-Length to requests with a body

Http-console should add a Content-Length header to all requests with a body. Some web servers (e.g. Nginx) refuse to respond to requests without it. Having to add it manually defeats the whole purpose of this tool.

'http-console' does not seem to work with Node.js on Windows...

There also seems to be a stray reference to an old Node.js module (require('sys')) on line 8 of 'http-console.js' file.
As for the bug itself? I install the module with npm, and enter the following into the command line:

node http-console localhost

Nothing is returned to the CLI.
I only find a blank cursor in reply.

Thought there be more interest in this project.
Given the state of cURL and Wget, it's quite, quite awsome...

.q and .header = unknown command

This happened with most latest release, running on OSX 10.6, node v. 0.2.6

"unknown command" returned for .q and .header. Thus .q didn't quit.

Also, is it possible to send data with a GET request?

Add support for HTTP Basic Auth

...either through a special \auth command, or by properly parsing URLs of the form username:password@hostname (currently everything after ":" is interpreted as a port number).

where is readline ?

http-console fails with:
module:238
throw new Error("Cannot find module '" + request + "'");
0 ^
Error: Cannot find module 'readline'
at loadModule (module:238:15)
at require (module:364:12)
at Object. (/home/badboy/code/http-console/lib/http-console.js:6:16)
at Module._compile (module:384:23)
at Module._loadScriptSync (module:393:16)
at Module.loadSync (module:296:10)
at loadModule (module:241:16)
at require (module:364:12)
at Object. (/home/badboy/code/http-console/bin/http-console:8:19)
at Module._compile (module:384:23)

where do I get readline?

What is NPM? How to install?

Hi,

Maybe it would be useful to explain a little bit what are the dependencies, what http-console is built on and how to install it besides launching npm install http-console.

Thanks

disconnect / reconnect behavior

so i'm not sure if this is an issue or not....

suppose im working on a web app, here is my workflow....

  1. i start the web app
  2. i start up http-console
  3. i perform a request with http-console
  4. successful request is successful
  5. shut down web app to make modification
  6. start up web app
  7. attempt to make a request with the still "connected" http-console
  8. http-console crashes out with : Error: sys is not defined

is that expected? do you see the workflow issue here?

thanks cloudhead! you rock!

After installing http-console won't start

patrick@Patrick-Quinn-Grahams-iMac:/Users/patrick$ http-console-0.3.3 localhost:80

module:238
throw new Error("Cannot find module '" + request + "'");
^
Error: Cannot find module 'http-console'
at loadModule (module:238:15)
at require (module:364:12)
at Object. (/usr/local/bin/http-console-0.3.3:8:19)
at Module._compile (module:381:21)
at Module._loadScriptSync (module:390:8)
at Module.loadSync (module:296:10)
at Object.runMain (module:444:22)
at node.js:253:10

Error: Cannot find module 'ext'

Seems like some dependency is missing.

$ node -v
v0.1.97
$ npm install http-console
$ http-console 127.0.0.1:80
module:238
        throw new Error("Cannot find module '" + request + "'");
              ^
Error: Cannot find module 'ext'
    at loadModule (module:238:15)
    at require (module:364:12)
    at Object.<anonymous> (/Users/felix/.node_libraries/.npm/http-console/0.2.0/package/lib/http-console.js:7:1)
    at Module._compile (module:384:23)
    at Module._loadScriptSync (module:393:16)
    at Module.loadSync (module:296:10)
    at loadModule (module:241:16)
    at require (module:364:12)
    at Object.<anonymous> (/Users/felix/.node_libraries/http-console.js:4:18)
    at Module._compile (module:384:23)

kiwi?

Is it blasphemy to ask why it's on npm vs. kiwi? Or why not both? I'm new to node, so I can't say which one is more popular or useful, but I do know that other packages I want to use with node (such as express) are already on there and I'd hate to have 2 package managers...

At any rate, just thought you'd give kiwi some consideration...

Cannot find module 'parselmouth'

Is "parselmouth" a previous name for lib/http-console.js?

module:238
    throw new Error("Cannot find module '" + request + "'");
          ^
Error: Cannot find module 'parselmouth'
    at loadModule (module:238:15)
    at require (module:364:12)
    at Object.<anonymous> (/Users/eager/.nvm/v0.1.96/bin/http-console:7:19)
    at Module._compile (module:384:23)
    at Module._loadScriptSync (module:393:16)
    at Module.loadSync (module:296:10)
    at Object.runMain (module:459:22)
    at node.js:196:8

Doesn't seem to work with v0.7.7-pre

I am trying to use your product but here is the output...

jackie@jackie-Latitude-E6410:/usr/local/lib/node_modules/http-console/bin$ node -v
v0.7.7-pre
jackie@jackie-Latitude-E6410:/usr/local/lib/node_modules/http-console/bin$ ./http-console

node.js:242
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.
at Function. (module.js:381:11)
at Object. (/usr/local/lib/node_modules/http-console/bin/http-console:6:8)
at Module._compile (module.js:444:26)
at Object..js (module.js:462:10)
at Module.load (module.js:351:32)
at Function._load (module.js:309:12)
at Array.0 (module.js:482:10)
at EventEmitter._tickCallback (node.js:233:41)
jackie@jackie-Latitude-E6410:/usr/local/lib/node_modules/http-console/bin$ echo $NODE_PATH
/usr/local/lib/node

Chunked Output

There should be a way to either disable chunked output, or get the next chunk. If there is, my apologies, how do you do it?

Background Colors for Response Body

Greetings,

It appears as if the background color of the response body (light gray) was chosen specifically for a console with a black background. I'm not opposed to switching the background of my console from white to black, but it seems a bit forceful for a single app to drive a system-level user preference.

Are the colors for HTTP Console configurable? If not, could you point me to a place in the code where I can change the hard-coded colors so that I can fork the code and make the change?

Thanks!
Scott

printResponse: sys is not defined

I'm getting a random error when doing multiple requests that result in non-json responses. There's no clear way to replicate it, but it looks like if I do several POST connections in a row with different POST data I'll get the error on 5th or 6th request:

http://www.google.ru:80/> POST
... 
HTTP/1.1 405 Method Not Allowed
Allow: GET, HEAD
Date: Sat, 12 Jun 2010 10:43:14 GMT
Content-Type: text/html; charset=UTF-8
Server: gws
Content-Length: 1391
X-Xss-Protection: 1; mode=block
Connection: close

ReferenceError: sys is not defined
    at [object Object].printResponse (/home/eugene/.node_libraries/.npm/http-console/0.3.0/package/lib/http-console.js:192:21)
    at /home/eugene/.node_libraries/.npm/http-console/0.3.0/package/lib/http-console.js:159:40
    at IncomingMessage. (/home/eugene/.node_libraries/.npm/http-console/0.3.0/package/lib/http-console.js:97:56)
    at IncomingMessage.emit (events:42:20)
    at HTTPParser.onMessageComplete (http:110:23)
    at Client.ondata (http:861:22)
    at IOWatcher.callback (net:502:31)
    at node.js:221:9

I've tried making the following change: eugenebolshakov/http-console@cb69a46ff5e23fe845bb34934b15156e8bdc89ae and it looks like the error doesn't occur anymore. However I can't really explain the reason :)

output full output

what my output is too larget, the http-console trim() it to a certain size.

how to output the full output?

Can't GET CouchDB databases with slash in the name

Databases like _users, blah, a123 are fine. But I have dbs that named like one/two, which is permitted in CouchDB. From node I request them with slash encoded as %2F - one%2Ftwo/document. With http-console, I can't access those dbs - I just get 404.

TypeError: Object true has no method 'write' ([email protected])

Hi,

$ uname -a
Darwin kunstderfuge.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26
3/RELEASE_I386 i386 i386 Macmini3,1 Darwin
~$ brew --version
0.8
~$ node --version
v0.4.2
~$ npm --version
0.3.15
~$ npm ls installed
[email protected] [...]
[email protected] [...]
[email protected] [...]
[email protected] [...]
npm ok
~$ http-console 127.0.0.1:8080

http-console 0.5.1
Welcome, enter \help if you're lost.
Connecting to 127.0.0.1 on port 8080.

TypeError: Object true has no method 'write'
at Interface.prompt (readline.js:103:17)
at [object Object].prompt (/usr/local/lib/node/.npm/http-console/0.5.1/package/lib/http-console.js:247:23)
at [object Object].initialize (/usr/local/lib/node/.npm/http-console/0.5.1/package/lib/http-console.js:71:14)
at Object. (/usr/local/lib/node/.npm/http-console/0.5.1/package/bin/http-console:89:9)
at Module._compile (module.js:383:26)
at Object..js (module.js:389:10)
at Module.load (module.js:315:31)
at Function._load (module.js:276:12)
at Array. (module.js:402:10)
at EventEmitter._tickCallback (node.js:108:26)

\help
\headers show active request headers.
\options show options.
\cookies show client cookies.
\json set 'Content-Type' header to 'application/json'.
\help display this message.
\exit exit console.
\q

TypeError: Object true has no method 'write'
at Interface.prompt (readline.js:103:17)
at [object Object].prompt (/usr/local/lib/node/.npm/http-console/0.5.1/package/lib/http-console.js:247:23)
at [object Object].exec (/usr/local/lib/node/.npm/http-console/0.5.1/package/lib/http-console.js:201:14)
at Interface. (/usr/local/lib/node/.npm/http-console/0.5.1/package/lib/http-console.js:60:18)
at Interface.emit (events.js:42:17)
at Interface._onLine (readline.js:132:10)
at Interface._normalWrite (readline.js:206:10)
at ReadStream. (readline.js:45:12)
at ReadStream.emit (events.js:59:20)
at ReadStream._onReadable (net.js:649:14)

Thanks

Http-Console fails assertion for writeable socket in GET

Node version: 0.3.2
Command Line: http-console localhost 8000 ( or http-console 127.0.0.1 )

http://localhost:8000> GET /

fails with an infinite loop on the following assertion error:

Error: assertion error
    at node.js:35:19
    at IOWatcher.onWritable [as callback] (net.js:164:5)

net.js:164:5 is an assertion:

 assert(socket.writable);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.