Code Monkey home page Code Monkey logo

Comments (8)

pilhuhn avatar pilhuhn commented on July 26, 2024 1

On 19 Jul 2016, at 10:48, abonas wrote:

I understand when it can happen code wise if you initialize the "base"
client - and indeed the above example would solve it. But iiic users
can also initialize directly the subclients, and then how would that
be handled for operations if URI is passed?

Yes, for a direct call into the subclient, it would also need a .to_s
in its uri = URI.parse ep line. Usually except for metrics-only
operation
of CM, people don't call the sub-clients without the parent.
We should make that more explicit / prominent though.

Also the above code subs https for ws, but you wrote that SSL is
not allowed, that part confuses me 😕

the https? regex allows for both http and https - I think that is
ok.
We catch both and then use a ws:uri.

from hawkular-client-ruby.

abonas avatar abonas commented on July 26, 2024

can you be a bit more specific what is the problem? the title is quite vague, I am kind of guessing what is not working :)
another gsub in addition to what? does not work in which way?

from hawkular-client-ruby.

abonas avatar abonas commented on July 26, 2024

regardless, do you know why gsub is used and not sub? (the latter is faster, it replaces the first occurence of the needed substring only, which in this case of protocol is reasonable)

from hawkular-client-ruby.

rubenvp8510 avatar rubenvp8510 commented on July 26, 2024

I think this issue is the same we had on URL normalization method #107 when we assume the entry point is a string, but it can be a URI object also.

Is this the same case? @pilhuhn

from hawkular-client-ruby.

pilhuhn avatar pilhuhn commented on July 26, 2024

On 18 Jul 2016, at 18:47, Ruben Vargas wrote:

I think this issue is the same we had on URL normalization method[1]
when we assume the entry point is a string, but it can be a URI object
also.

Is this the same case? @pilhuhn

Yes

from hawkular-client-ruby.

abonas avatar abonas commented on July 26, 2024

lets say we've received here a URI. I am not sure whether uri object works at all with ws.
meaning - the user was able to actually create a uri object intended for operation with websockets?

from hawkular-client-ruby.

pilhuhn avatar pilhuhn commented on July 26, 2024

This happens when you go

uri = URI.parse('http://..')
hash = { entrypoint: uri, ... }
client=Hawkular::Client.new(hash)
ops = client.operations

I think it is enough to modify

Operations::OperationsClient.new(entrypoint: @state[:entrypoint].gsub(/^https?/, 'ws'),

to

Operations::OperationsClient.new(entrypoint: @state[:entrypoint].to_s.sub(/^https?/, 'ws'),

We need to revisit the whole WS handling once we allow for SSL, which we don't do yet (then the operations client also needs more code internally iirc).

from hawkular-client-ruby.

abonas avatar abonas commented on July 26, 2024

I understand when it can happen code wise if you initialize the "base" client - and indeed the above example would solve it. But iiic users can also initialize directly the subclients, and then how would that be handled for operations/ws if URI is passed? (my point is that if operations client works only with websockets, supporting accepting an URI object here if it can't represent ws is incorrect in the first place. clearly it can be solved in code)
Also the above code subs https for ws, but you wrote that SSL is not allowed, that part confuses me 😕

from hawkular-client-ruby.

Related Issues (20)

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.