commit | 278d040c3c4b38ab73797281eadb30733b92de6b | [log] [tgz] |
---|---|---|
author | Todd Wang <toddw@google.com> | Wed Apr 15 22:51:47 2015 -0700 |
committer | Todd Wang <toddw@google.com> | Wed Apr 15 22:51:48 2015 -0700 |
tree | 7cc1e3363a8f713d4d93f063e57de200622bf985 | |
parent | b32cc42a697bdb4a35bf35da7270ec0cd941d170 [diff] |
pipe2browser: Move context.T out of rpc.ServerCall. The purpose of this change is to make our usage of context.T more consistent; it was a bit lame that we gave guidance to never wrap context.T in another type, but were doing it ourselves. The JS code is also being changed to follow this convention (in separate CLs), so we'll be consistent between Go and JS as well. The server implementation used to look like this: func (*impl) Foo(call rpc.ServerCall, ...) Now it looks like this: func (*impl) Foo(ctx *context.T, call rpc.ServerCall, ...) Also added a ServerCall.Security() function, which returns the security.Call. The security.Call is still embedded inside context.T for now; a subsequent change will remove it from context.T and add an explicit security.Call argument where necessary. That's a separate CL since some of the choices may be more controversial, and it's a smaller set of changes. Change-Id: I7040035486f69cff3aaf215e3a9d8e797b79c6cf MultiPart: 6/8
P2B allows one to pipe anything from shell console to the browser. Data being piped to the browser then is displayed in a graphical and formatted way by a “viewer” Viewers are pluggable pieces of code that know how to handle and display a stream of data.
For example one can do:
echo "Hi!" | p2b users/jane@google.com/chrome/p2b/jane/console
or
cat cat.jpg | p2b -binary users/jane@google.com/chrome/p2b/jane/image
where users/jane@google.com/chrome/p2b is the Object name where p2b service is running in the browser. The suffix console or image specifies what viewer should be used to display the data.
Please see the help page inside the P2B application for detailed tutorials.
To build make
To run make go/bin/p2b #Builds the p2b binary make start #Starts a web server at 8080
and then navigate to http://localhost:8080 and publish under a name such as ‘foo’ and run p2b rpc under vbash with commands such as
# run vbash $V23_ROOT/release/go/src/v.io/x/ref/cmd/vbash # run a sample p2b command echo "Hello World" | go/bin/p2b users/<email-address>/chrome/p2b/foo/console
To stop simply Ctrl-C the console that started it
To clean make clean