FAQ
I need a service which can be accessed from other languages, mainly Python,
Ruby, Java and JavaScript.

My first try was to use JSON-RPC over HTTP but I have seen that there were
issues related to the access from other languages, at least with Python:

https://groups.google.com/forum/#!searchin/golang-nuts/jsonrpc$20http/golang-nuts/6sCvbBaZvtI/9nranppurPYJ

Does anybody has checked the access from other languages to a JSON-RPC
server in Go?
Do you know a better alternative to JSON-RPC in Go? Any framework to build
the API of a web service?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Andy Bonventre at Oct 30, 2013 at 12:04 pm
    I have not seen any issue at all communicating with a service written in Go
    using JSON-RPC.

    At one point our web frontends were written in Node with our app servers
    written in Go. We easily communicated using JSON-RPC over TCP without any
    issues (https://github.com/poptip/node-jsonrpc-tcp).

    Andy

    On Wed, Oct 30, 2013 at 7:37 AM, Archos wrote:

    I need a service which can be accessed from other languages, mainly
    Python, Ruby, Java and JavaScript.

    My first try was to use JSON-RPC over HTTP but I have seen that there were
    issues related to the access from other languages, at least with Python:


    https://groups.google.com/forum/#!searchin/golang-nuts/jsonrpc$20http/golang-nuts/6sCvbBaZvtI/9nranppurPYJ

    Does anybody has checked the access from other languages to a JSON-RPC
    server in Go?
    Do you know a better alternative to JSON-RPC in Go? Any framework to build
    the API of a web service?

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Matthew Fonda at Oct 30, 2013 at 2:53 pm
    Hi Archos,

    I am using a Go JSON-RPC service via PHP. I found it really straightforward
    to use. See
    https://github.com/mfonda/php-s3q/blob/master/src/S3Q/Uploader.php#L55

    Best regards,
    --Matthew

    On Wed, Oct 30, 2013 at 4:37 AM, Archos wrote:

    I need a service which can be accessed from other languages, mainly
    Python, Ruby, Java and JavaScript.

    My first try was to use JSON-RPC over HTTP but I have seen that there were
    issues related to the access from other languages, at least with Python:


    https://groups.google.com/forum/#!searchin/golang-nuts/jsonrpc$20http/golang-nuts/6sCvbBaZvtI/9nranppurPYJ

    Does anybody has checked the access from other languages to a JSON-RPC
    server in Go?
    Do you know a better alternative to JSON-RPC in Go? Any framework to build
    the API of a web service?

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kyle Lemons at Oct 31, 2013 at 12:03 am

    On Wed, Oct 30, 2013 at 4:37 AM, Archos wrote:

    I need a service which can be accessed from other languages, mainly
    Python, Ruby, Java and JavaScript.

    My first try was to use JSON-RPC over HTTP but I have seen that there were
    issues related to the access from other languages, at least with Python:


    https://groups.google.com/forum/#!searchin/golang-nuts/jsonrpc$20http/golang-nuts/6sCvbBaZvtI/9nranppurPYJ
    As far as I know, as long as you understand that all RPC calls to Go take
    one argument and return one value, you should be fine. I have used them
    from Java and Curl and with our own simple Python jsonrpc without any issue.

    Does anybody has checked the access from other languages to a JSON-RPC
    server in Go?
    Do you know a better alternative to JSON-RPC in Go? Any framework to build
    the API of a web service?

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kamil Kisiel at Oct 31, 2013 at 12:42 am
    I tried to get this to work with this fairly simple
    example: https://github.com/kisielk/jsonrpc-example but my ServeCodec seems
    to hang.

    Any idea as to what I am doing wrong?
    On Wednesday, October 30, 2013 5:03:30 PM UTC-7, Kyle Lemons wrote:

    On Wed, Oct 30, 2013 at 4:37 AM, Archos <raul...@sent.com <javascript:>>wrote:
    I need a service which can be accessed from other languages, mainly
    Python, Ruby, Java and JavaScript.

    My first try was to use JSON-RPC over HTTP but I have seen that there
    were issues related to the access from other languages, at least with
    Python:


    https://groups.google.com/forum/#!searchin/golang-nuts/jsonrpc$20http/golang-nuts/6sCvbBaZvtI/9nranppurPYJ
    As far as I know, as long as you understand that all RPC calls to Go take
    one argument and return one value, you should be fine. I have used them
    from Java and Curl and with our own simple Python jsonrpc without any issue.

    Does anybody has checked the access from other languages to a JSON-RPC
    server in Go?
    Do you know a better alternative to JSON-RPC in Go? Any framework to build
    the API of a web service?

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jesse McNelis at Oct 31, 2013 at 12:49 am

    On Thu, Oct 31, 2013 at 11:42 AM, Kamil Kisiel wrote:

    I tried to get this to work with this fairly simple example:
    https://github.com/kisielk/jsonrpc-example but my ServeCodec seems to
    hang.

    Any idea as to what I am doing wrong?
    Is there any reason you're not using
    http://golang.org/pkg/net/rpc/#Server.ServeHTTP
    http://golang.org/src/pkg/net/rpc/server.go?s=19533:19606#L640 is quite
    similar to your example.

    On Wednesday, October 30, 2013 5:03:30 PM UTC-7, Kyle Lemons wrote:
    On Wed, Oct 30, 2013 at 4:37 AM, Archos wrote:

    I need a service which can be accessed from other languages, mainly
    Python, Ruby, Java and JavaScript.

    My first try was to use JSON-RPC over HTTP but I have seen that there
    were issues related to the access from other languages, at least with
    Python:

    https://groups.google.com/**forum/#!searchin/golang-nuts/**
    jsonrpc$20http/golang-nuts/**6sCvbBaZvtI/9nranppurPYJ<https://groups.google.com/forum/#!searchin/golang-nuts/jsonrpc$20http/golang-nuts/6sCvbBaZvtI/9nranppurPYJ>
    As far as I know, as long as you understand that all RPC calls to Go take
    one argument and return one value, you should be fine. I have used them
    from Java and Curl and with our own simple Python jsonrpc without any issue.

    Does anybody has checked the access from other languages to a JSON-RPC
    server in Go?
    Do you know a better alternative to JSON-RPC in Go? Any framework to
    build the API of a web service?

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts...@**googlegroups.com.

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    =====================
    http://jessta.id.au

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kamil Kisiel at Oct 31, 2013 at 12:51 am
    ServeHTTP is implemented in terms of ServeConn. From the docs just above:

      ServeConn uses the gob wire format (see package gob) on the connection. To
    use an alternate codec, use ServeCodec.

    On Wednesday, October 30, 2013 5:49:55 PM UTC-7, Jesse McNelis wrote:

    On Thu, Oct 31, 2013 at 11:42 AM, Kamil Kisiel <kamil....@gmail.com<javascript:>
    wrote:
    I tried to get this to work with this fairly simple example:
    https://github.com/kisielk/jsonrpc-example but my ServeCodec seems to
    hang.

    Any idea as to what I am doing wrong?
    Is there any reason you're not using
    http://golang.org/pkg/net/rpc/#Server.ServeHTTP
    http://golang.org/src/pkg/net/rpc/server.go?s=19533:19606#L640 is quite
    similar to your example.

    On Wednesday, October 30, 2013 5:03:30 PM UTC-7, Kyle Lemons wrote:
    On Wed, Oct 30, 2013 at 4:37 AM, Archos wrote:

    I need a service which can be accessed from other languages, mainly
    Python, Ruby, Java and JavaScript.

    My first try was to use JSON-RPC over HTTP but I have seen that there
    were issues related to the access from other languages, at least with
    Python:

    https://groups.google.com/**forum/#!searchin/golang-nuts/**
    jsonrpc$20http/golang-nuts/**6sCvbBaZvtI/9nranppurPYJ<https://groups.google.com/forum/#!searchin/golang-nuts/jsonrpc$20http/golang-nuts/6sCvbBaZvtI/9nranppurPYJ>
    As far as I know, as long as you understand that all RPC calls to Go
    take one argument and return one value, you should be fine. I have used
    them from Java and Curl and with our own simple Python jsonrpc without any
    issue.

    Does anybody has checked the access from other languages to a JSON-RPC
    server in Go?
    Do you know a better alternative to JSON-RPC in Go? Any framework to
    build the API of a web service?

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts...@**googlegroups.com.

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    =====================
    http://jessta.id.au
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Stephen Day at Oct 31, 2013 at 1:14 am
    This gist [1] demonstrates use of go jsonrpc with python. It's from awhile
    ago, so it will need adjustments, but the concepts are the same. Let me
    know if you have questions.

    [1]: https://gist.github.com/stevvooe/1164621
    On Wednesday, October 30, 2013 5:51:36 PM UTC-7, Kamil Kisiel wrote:

    ServeHTTP is implemented in terms of ServeConn. From the docs just above:

    ServeConn uses the gob wire format (see package gob) on the connection.
    To use an alternate codec, use ServeCodec.

    On Wednesday, October 30, 2013 5:49:55 PM UTC-7, Jesse McNelis wrote:
    On Thu, Oct 31, 2013 at 11:42 AM, Kamil Kisiel wrote:

    I tried to get this to work with this fairly simple example:
    https://github.com/kisielk/jsonrpc-example but my ServeCodec seems to
    hang.

    Any idea as to what I am doing wrong?
    Is there any reason you're not using
    http://golang.org/pkg/net/rpc/#Server.ServeHTTP
    http://golang.org/src/pkg/net/rpc/server.go?s=19533:19606#L640 is quite
    similar to your example.

    On Wednesday, October 30, 2013 5:03:30 PM UTC-7, Kyle Lemons wrote:
    On Wed, Oct 30, 2013 at 4:37 AM, Archos wrote:

    I need a service which can be accessed from other languages, mainly
    Python, Ruby, Java and JavaScript.

    My first try was to use JSON-RPC over HTTP but I have seen that there
    were issues related to the access from other languages, at least with
    Python:

    https://groups.google.com/**forum/#!searchin/golang-nuts/**
    jsonrpc$20http/golang-nuts/**6sCvbBaZvtI/9nranppurPYJ<https://groups.google.com/forum/#!searchin/golang-nuts/jsonrpc$20http/golang-nuts/6sCvbBaZvtI/9nranppurPYJ>
    As far as I know, as long as you understand that all RPC calls to Go
    take one argument and return one value, you should be fine. I have used
    them from Java and Curl and with our own simple Python jsonrpc without any
    issue.

    Does anybody has checked the access from other languages to a JSON-RPC
    server in Go?
    Do you know a better alternative to JSON-RPC in Go? Any framework to
    build the API of a web service?

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts...@**googlegroups.com.

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    =====================
    http://jessta.id.au
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kamil Kisiel at Oct 31, 2013 at 6:26 am
    Yes, it works fine over raw sockets it seems. Trying to make it work as an
    HTTP handler on the other hand...
    On Wednesday, October 30, 2013 6:14:22 PM UTC-7, Stephen Day wrote:

    This gist [1] demonstrates use of go jsonrpc with python. It's from awhile
    ago, so it will need adjustments, but the concepts are the same. Let me
    know if you have questions.

    [1]: https://gist.github.com/stevvooe/1164621
    On Wednesday, October 30, 2013 5:51:36 PM UTC-7, Kamil Kisiel wrote:

    ServeHTTP is implemented in terms of ServeConn. From the docs just above:

    ServeConn uses the gob wire format (see package gob) on the connection.
    To use an alternate codec, use ServeCodec.

    On Wednesday, October 30, 2013 5:49:55 PM UTC-7, Jesse McNelis wrote:
    On Thu, Oct 31, 2013 at 11:42 AM, Kamil Kisiel wrote:

    I tried to get this to work with this fairly simple example:
    https://github.com/kisielk/jsonrpc-example but my ServeCodec seems to
    hang.

    Any idea as to what I am doing wrong?
    Is there any reason you're not using
    http://golang.org/pkg/net/rpc/#Server.ServeHTTP
    http://golang.org/src/pkg/net/rpc/server.go?s=19533:19606#L640 is quite
    similar to your example.

    On Wednesday, October 30, 2013 5:03:30 PM UTC-7, Kyle Lemons wrote:
    On Wed, Oct 30, 2013 at 4:37 AM, Archos wrote:

    I need a service which can be accessed from other languages, mainly
    Python, Ruby, Java and JavaScript.

    My first try was to use JSON-RPC over HTTP but I have seen that there
    were issues related to the access from other languages, at least with
    Python:

    https://groups.google.com/**forum/#!searchin/golang-nuts/**
    jsonrpc$20http/golang-nuts/**6sCvbBaZvtI/9nranppurPYJ<https://groups.google.com/forum/#!searchin/golang-nuts/jsonrpc$20http/golang-nuts/6sCvbBaZvtI/9nranppurPYJ>
    As far as I know, as long as you understand that all RPC calls to Go
    take one argument and return one value, you should be fine. I have used
    them from Java and Curl and with our own simple Python jsonrpc without any
    issue.

    Does anybody has checked the access from other languages to a
    JSON-RPC server in Go?
    Do you know a better alternative to JSON-RPC in Go? Any framework to
    build the API of a web service?

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to golang-nuts...@**googlegroups.com.

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    =====================
    http://jessta.id.au
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Elias Naur at Oct 31, 2013 at 6:54 am
    I personally use the gorilla framework for JSON-RPC access through HTTP
    handlers. Specifically, http://www.gorillatoolkit.org/pkg/rpc/v2/json2

      - elias
    On Thursday, October 31, 2013 7:26:33 AM UTC+1, Kamil Kisiel wrote:

    Yes, it works fine over raw sockets it seems. Trying to make it work as an
    HTTP handler on the other hand...
    On Wednesday, October 30, 2013 6:14:22 PM UTC-7, Stephen Day wrote:

    This gist [1] demonstrates use of go jsonrpc with python. It's from
    awhile ago, so it will need adjustments, but the concepts are the same. Let
    me know if you have questions.

    [1]: https://gist.github.com/stevvooe/1164621
    On Wednesday, October 30, 2013 5:51:36 PM UTC-7, Kamil Kisiel wrote:

    ServeHTTP is implemented in terms of ServeConn. From the docs just above:

    ServeConn uses the gob wire format (see package gob) on the connection.
    To use an alternate codec, use ServeCodec.

    On Wednesday, October 30, 2013 5:49:55 PM UTC-7, Jesse McNelis wrote:
    On Thu, Oct 31, 2013 at 11:42 AM, Kamil Kisiel wrote:

    I tried to get this to work with this fairly simple example:
    https://github.com/kisielk/jsonrpc-example but my ServeCodec seems to
    hang.

    Any idea as to what I am doing wrong?
    Is there any reason you're not using
    http://golang.org/pkg/net/rpc/#Server.ServeHTTP
    http://golang.org/src/pkg/net/rpc/server.go?s=19533:19606#L640 is
    quite similar to your example.

    On Wednesday, October 30, 2013 5:03:30 PM UTC-7, Kyle Lemons wrote:
    On Wed, Oct 30, 2013 at 4:37 AM, Archos wrote:

    I need a service which can be accessed from other languages, mainly
    Python, Ruby, Java and JavaScript.

    My first try was to use JSON-RPC over HTTP but I have seen that
    there were issues related to the access from other languages, at least with
    Python:

    https://groups.google.com/**forum/#!searchin/golang-nuts/**
    jsonrpc$20http/golang-nuts/**6sCvbBaZvtI/9nranppurPYJ<https://groups.google.com/forum/#!searchin/golang-nuts/jsonrpc$20http/golang-nuts/6sCvbBaZvtI/9nranppurPYJ>
    As far as I know, as long as you understand that all RPC calls to Go
    take one argument and return one value, you should be fine. I have used
    them from Java and Curl and with our own simple Python jsonrpc without any
    issue.

    Does anybody has checked the access from other languages to a
    JSON-RPC server in Go?
    Do you know a better alternative to JSON-RPC in Go? Any framework to
    build the API of a web service?

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to golang-nuts...@**googlegroups.com.

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    =====================
    http://jessta.id.au
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Archos at Oct 31, 2013 at 8:16 pm
    Thanks to all.
    Anyway, I also will add access through a web API, to be able to compare
    JSON-RPC vs messaging over time.

    El jueves, 31 de octubre de 2013 06:54:52 UTC, Elias Naur escribió:
    I personally use the gorilla framework for JSON-RPC access through HTTP
    handlers. Specifically, http://www.gorillatoolkit.org/pkg/rpc/v2/json2

    - elias
    On Thursday, October 31, 2013 7:26:33 AM UTC+1, Kamil Kisiel wrote:

    Yes, it works fine over raw sockets it seems. Trying to make it work as
    an HTTP handler on the other hand...
    On Wednesday, October 30, 2013 6:14:22 PM UTC-7, Stephen Day wrote:

    This gist [1] demonstrates use of go jsonrpc with python. It's from
    awhile ago, so it will need adjustments, but the concepts are the same. Let
    me know if you have questions.

    [1]: https://gist.github.com/stevvooe/1164621
    On Wednesday, October 30, 2013 5:51:36 PM UTC-7, Kamil Kisiel wrote:

    ServeHTTP is implemented in terms of ServeConn. From the docs just
    above:

    ServeConn uses the gob wire format (see package gob) on the
    connection. To use an alternate codec, use ServeCodec.

    On Wednesday, October 30, 2013 5:49:55 PM UTC-7, Jesse McNelis wrote:
    On Thu, Oct 31, 2013 at 11:42 AM, Kamil Kisiel wrote:

    I tried to get this to work with this fairly simple example:
    https://github.com/kisielk/jsonrpc-example but my ServeCodec seems
    to hang.

    Any idea as to what I am doing wrong?
    Is there any reason you're not using
    http://golang.org/pkg/net/rpc/#Server.ServeHTTP
    http://golang.org/src/pkg/net/rpc/server.go?s=19533:19606#L640 is
    quite similar to your example.

    On Wednesday, October 30, 2013 5:03:30 PM UTC-7, Kyle Lemons wrote:
    On Wed, Oct 30, 2013 at 4:37 AM, Archos wrote:

    I need a service which can be accessed from other languages, mainly
    Python, Ruby, Java and JavaScript.

    My first try was to use JSON-RPC over HTTP but I have seen that
    there were issues related to the access from other languages, at least with
    Python:

    https://groups.google.com/**forum/#!searchin/golang-nuts/**
    jsonrpc$20http/golang-nuts/**6sCvbBaZvtI/9nranppurPYJ<https://groups.google.com/forum/#!searchin/golang-nuts/jsonrpc$20http/golang-nuts/6sCvbBaZvtI/9nranppurPYJ>
    As far as I know, as long as you understand that all RPC calls to Go
    take one argument and return one value, you should be fine. I have used
    them from Java and Curl and with our own simple Python jsonrpc without any
    issue.

    Does anybody has checked the access from other languages to a
    JSON-RPC server in Go?
    Do you know a better alternative to JSON-RPC in Go? Any framework to
    build the API of a web service?

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to golang-nuts...@**googlegroups.com.

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to golang-nuts...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    =====================
    http://jessta.id.au
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kelsey Hightower at Jan 20, 2015 at 3:13 am
    I know this is an old thread, but I never found a solution for making
    net/rpc work over HTTP with the jsonrpc encoding. So I put together some
    examples on GitHub:

    https://github.com/kelseyhightower/jsonrpc-server

    Hope this helps others trying to figure this out.
    On Wednesday, October 30, 2013 at 11:26:33 PM UTC-7, Kamil Kisiel wrote:

    Yes, it works fine over raw sockets it seems. Trying to make it work as an
    HTTP handler on the other hand...
    On Wednesday, October 30, 2013 6:14:22 PM UTC-7, Stephen Day wrote:

    This gist [1] demonstrates use of go jsonrpc with python. It's from
    awhile ago, so it will need adjustments, but the concepts are the same. Let
    me know if you have questions.

    [1]: https://gist.github.com/stevvooe/1164621
    On Wednesday, October 30, 2013 5:51:36 PM UTC-7, Kamil Kisiel wrote:

    ServeHTTP is implemented in terms of ServeConn. From the docs just above:

    ServeConn uses the gob wire format (see package gob) on the connection.
    To use an alternate codec, use ServeCodec.

    On Wednesday, October 30, 2013 5:49:55 PM UTC-7, Jesse McNelis wrote:

    On Thu, Oct 31, 2013 at 11:42 AM, Kamil Kisiel <kamil....@gmail.com>
    wrote:
    I tried to get this to work with this fairly simple example:
    https://github.com/kisielk/jsonrpc-example but my ServeCodec seems to
    hang.

    Any idea as to what I am doing wrong?
    Is there any reason you're not using
    http://golang.org/pkg/net/rpc/#Server.ServeHTTP
    http://golang.org/src/pkg/net/rpc/server.go?s=19533:19606#L640 is
    quite similar to your example.

    On Wednesday, October 30, 2013 5:03:30 PM UTC-7, Kyle Lemons wrote:
    On Wed, Oct 30, 2013 at 4:37 AM, Archos wrote:

    I need a service which can be accessed from other languages, mainly
    Python, Ruby, Java and JavaScript.

    My first try was to use JSON-RPC over HTTP but I have seen that
    there were issues related to the access from other languages, at least with
    Python:

    https://groups.google.com/forum/#!searchin/golang-nuts/
    jsonrpc$20http/golang-nuts/6sCvbBaZvtI/9nranppurPYJ
    As far as I know, as long as you understand that all RPC calls to Go
    take one argument and return one value, you should be fine. I have used
    them from Java and Curl and with our own simple Python jsonrpc without any
    issue.

    Does anybody has checked the access from other languages to a
    JSON-RPC server in Go?
    Do you know a better alternative to JSON-RPC in Go? Any framework to
    build the API of a web service?

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to golang-nuts...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    =====================
    http://jessta.id.au
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Rif at Jan 20, 2015 at 4:25 pm
    It helped me a lot, thank you.

    I had to move r.done <- true in the Write method because sometimes I got
    empty answers. Seemed like Close was called before Write finished or
    something.

    marți, 20 ianuarie 2015, 05:13:53 UTC+2, Kelsey Hightower a scris:
    I know this is an old thread, but I never found a solution for making
    net/rpc work over HTTP with the jsonrpc encoding. So I put together some
    examples on GitHub:

    https://github.com/kelseyhightower/jsonrpc-server

    Hope this helps others trying to figure this out.
    On Wednesday, October 30, 2013 at 11:26:33 PM UTC-7, Kamil Kisiel wrote:

    Yes, it works fine over raw sockets it seems. Trying to make it work as
    an HTTP handler on the other hand...
    On Wednesday, October 30, 2013 6:14:22 PM UTC-7, Stephen Day wrote:

    This gist [1] demonstrates use of go jsonrpc with python. It's from
    awhile ago, so it will need adjustments, but the concepts are the same. Let
    me know if you have questions.

    [1]: https://gist.github.com/stevvooe/1164621
    On Wednesday, October 30, 2013 5:51:36 PM UTC-7, Kamil Kisiel wrote:

    ServeHTTP is implemented in terms of ServeConn. From the docs just
    above:

    ServeConn uses the gob wire format (see package gob) on the
    connection. To use an alternate codec, use ServeCodec.

    On Wednesday, October 30, 2013 5:49:55 PM UTC-7, Jesse McNelis wrote:

    On Thu, Oct 31, 2013 at 11:42 AM, Kamil Kisiel <kamil....@gmail.com>
    wrote:
    I tried to get this to work with this fairly simple example:
    https://github.com/kisielk/jsonrpc-example but my ServeCodec seems
    to hang.

    Any idea as to what I am doing wrong?
    Is there any reason you're not using
    http://golang.org/pkg/net/rpc/#Server.ServeHTTP
    http://golang.org/src/pkg/net/rpc/server.go?s=19533:19606#L640 is
    quite similar to your example.

    On Wednesday, October 30, 2013 5:03:30 PM UTC-7, Kyle Lemons wrote:
    On Wed, Oct 30, 2013 at 4:37 AM, Archos wrote:

    I need a service which can be accessed from other languages, mainly
    Python, Ruby, Java and JavaScript.

    My first try was to use JSON-RPC over HTTP but I have seen that
    there were issues related to the access from other languages, at least with
    Python:

    https://groups.google.com/forum/#!searchin/golang-nuts/
    jsonrpc$20http/golang-nuts/6sCvbBaZvtI/9nranppurPYJ
    As far as I know, as long as you understand that all RPC calls to Go
    take one argument and return one value, you should be fine. I have used
    them from Java and Curl and with our own simple Python jsonrpc without any
    issue.

    Does anybody has checked the access from other languages to a
    JSON-RPC server in Go?
    Do you know a better alternative to JSON-RPC in Go? Any framework to
    build the API of a web service?

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to golang-nuts...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to golang-nuts...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    =====================
    http://jessta.id.au
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Fumin Wang at Oct 31, 2013 at 2:47 am
    I've also be able to make ruby clients talk to Go JSON-RPC servers.

    Here's an example of a ruby client and a Go server:
    Client: https://github.com/fumin/rtree/blob/master/rtree/client.rb
    Server: https://github.com/fumin/rtree/blob/master/rtree/rtree.go

    From the ruby code, we can see the underlying protocol of Go's JSON-RPC is
    pretty
    simple, just a hash that consists of the keys "method", "params", and "id"
    (for multiplexing within the same socket)

    In short, a typical ruby client should look something like:

    b = {method: "Store.RtreeInsert",
          params: [{"Key" => key,
                    "Member" => member,
                    "Where" => {"Point" => point, "Lengths" => lengths}}],
          id: rand(1000)}
    @sock.write(JSON.dump(b))
    resp = JSON.load(@sock.readline)
    # Do anything we want with the response, resp.

    On Wednesday, 30 October 2013 19:37:59 UTC+8, Archos wrote:

    I need a service which can be accessed from other languages, mainly
    Python, Ruby, Java and JavaScript.

    My first try was to use JSON-RPC over HTTP but I have seen that there were
    issues related to the access from other languages, at least with Python:


    https://groups.google.com/forum/#!searchin/golang-nuts/jsonrpc$20http/golang-nuts/6sCvbBaZvtI/9nranppurPYJ

    Does anybody has checked the access from other languages to a JSON-RPC
    server in Go?
    Do you know a better alternative to JSON-RPC in Go? Any framework to build
    the API of a web service?
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 30, '13 at 11:38a
activeJan 20, '15 at 4:25p
posts14
users11
websitegolang.org

People

Translate

site design / logo © 2017 Grokbase