Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPTransportの追加 #252

Merged
merged 1 commit into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions OpenRTM_aist/ext/http/HTTPTransport.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


##
# @file HTTPTransport.py
# @brief HTTP Transport module
# @date $Date: $
# @author Nobuhiko Miyamoto


import os
from omniORB import httpTP
import OpenRTM_aist


def HTTPTransportInit(manager):

#os.environ['ORBtraceLevel'] = '25'
#os.environ['ORBendPoint'] = 'giop:http:ws://127.0.0.1:2810/ws'
#os.environ['ORBsslVerifyMode'] = "none"

prop = manager.getConfig()
certificate_authority_file = prop.getProperty(
"corba.http.certificate_authority_file")
key_file = prop.getProperty("corba.http.key_file")
key_file_password = prop.getProperty("corba.http.key_file_password")

corba_args = prop.getProperty("corba.args")

if not ("giop:http" in corba_args):
corba_args += " -ORBendPoint giop:http:ws://127.0.0.1:8001/ws"

if not OpenRTM_aist.toBool(prop.getProperty(
"manager.is_master"), "YES", "NO", True):
if not prop.getProperty("corba.endpoints"):
if not prop.getProperty("corba.endpoint"):
if str(prop.getProperty("corba.args")).find(
"-ORBendPoint") == -1:
corba_args += " -ORBendPoint giop:tcp::"

prop.setProperty("corba.args", corba_args)

if certificate_authority_file:
httpTP.set_CA(certificate_authority_file, None)
if key_file or key_file_password:
httpTP.set_key(key_file, key_file_password)
1 change: 1 addition & 0 deletions OpenRTM_aist/ext/http/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Empty file
10 changes: 10 additions & 0 deletions OpenRTM_aist/ext/http/rtc.http.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
logger.enable: YES
logger.log_level: DEBUG
#logger.file_name: stdout

manager.modules.load_path: ./
manager.preload.modules: HTTPTransport.py

corba.args:-ORBserverTransportRule "* http" -ORBclientTransportRule "* http" -ORBendPoint giop:http:http:///call
corba.nameservers: http://127.0.0.1:2809/call
corba.master_manager: giop:http:http://127.0.0.1:2810/call
14 changes: 14 additions & 0 deletions OpenRTM_aist/ext/http/rtc.https.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
logger.enable: YES
logger.log_level: DEBUG
#logger.file_name: stdout

manager.modules.load_path: ./
manager.preload.modules: HTTPTransport.py

corba.http.certificate_authority_file:../ssl/test/root.crt
corba.http.key_file:../ssl/test/server.pem
corba.http.key_file_password:password

corba.args:-ORBserverTransportRule "* http" -ORBclientTransportRule "* http" -ORBendPoint giop:http:https:///call
corba.nameservers: https://127.0.0.1:2809/call
corba.master_manager: giop:http:https://127.0.0.1:2810/call
10 changes: 10 additions & 0 deletions OpenRTM_aist/ext/http/rtc.ws.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
logger.enable: YES
logger.log_level: DEBUG
#logger.file_name: stdout

manager.modules.load_path: ./
manager.preload.modules: HTTPTransport.py

corba.args:-ORBserverTransportRule "* http" -ORBclientTransportRule "* http" -ORBendPoint giop:http:ws:///ws
corba.nameservers: ws://127.0.0.1:2809/ws
corba.master_manager: giop:http:ws://127.0.0.1:2810/ws
14 changes: 14 additions & 0 deletions OpenRTM_aist/ext/http/rtc.wss.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
logger.enable: YES
logger.log_level: DEBUG
#logger.file_name: stdout

manager.modules.load_path: ./
manager.preload.modules: HTTPTransport.py

corba.http.certificate_authority_file:../ssl/test/root.crt
corba.http.key_file:../ssl/test/server.pem
corba.http.key_file_password:password

corba.args:-ORBserverTransportRule "* http" -ORBclientTransportRule "* http" -ORBendPoint giop:http:wss:///ws
corba.nameservers: wss://127.0.0.1:2809/ws
corba.master_manager: giop:http:wss://127.0.0.1:2810/ws
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def os_is():
"OpenRTM_aist.ext.sdo",
"OpenRTM_aist.ext.sdo.observer",
"OpenRTM_aist.ext.ssl",
"OpenRTM_aist.ext.http",
"OpenRTM_aist.ext.logger",
"OpenRTM_aist.ext.logger.fluentlogger",
"OpenRTM_aist.ext.transport",
Expand Down