Embed Jetty in Eclipse RCP

2019-06-02 08:24发布

I am building a RCP application , where I need to monitor http traffic and show it to user. For that I require use of Embeded Jetty as transparent proxy.

I tried everything , followed this Tutorial But things just don't work. I get build exception. I tried adding Jetty jar as external dependency , but still no use.

Would appreciate any help. Also please let me know if there are any other ways of achieving this without use of jetty. (I tried Socks but it conflicts with RCP UI thread) Thank You.

1条回答
欢心
2楼-- · 2019-06-02 08:58

In broad terms you need to look into making eclipse plugins and how to declare dependencies in eclipse plugin projects. What you are basically looking to do is write a bit of code based on our jetty embedded examples only in a plugin context, so when your plugin loads it would trigger the starting of the jetty server. You will load the jetty dependencies as osgi bundles. Note that in juno much of jetty 8.1.3 will be available by default.

Its not the best example in the world, but you can look at our crusty wtp plugin for some ideas, at least on how you could configure things using tycho and maybe some organizational bits.

http://git.eclipse.org/c/jetty/org.eclipse.jetty.wtp.git/

查看更多
登录 后发表回答