Skip to content

Commit

Permalink
Merge pull request #252 from Nobu19800/feature/httptransport
Browse files Browse the repository at this point in the history
HTTPTransportの追加
  • Loading branch information
Nobu19800 authored Jan 25, 2022
2 parents 6d3a88c + 0135bfe commit b437b46
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 0 deletions.
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

0 comments on commit b437b46

Please sign in to comment.